Exception handling

Errors that occur in the execution of a method of a Web service are converted to SoapException objects and thrown to the calling script. The methods of the SoapConnection object in PBWSClient190.pbx and PBSoapClient190.pbx can also throw SoapException objects when, for example, connection to the server fails, or the Web service cannot be located or created.

Catching exceptions

A client application can handle communications errors in a number of ways. For example, if a client connects to a server and tries to invoke a method for an object that does not exist, the client can disconnect from the server, connect to a different server, or retry the operation. Alternatively, the client can display a message to the user and give the user the opportunity to control what happens next.

When an error occurs, if the client connects to a new server to retry the operation, it must instantiate the remote object on the new server before invoking a method of the remote object.

Unhandled exceptions

If no exception handler exists, or if the existing exception handlers do not handle the exception, the SystemError event on the Application object is executed. If the SystemError event has no script, an application error occurs and the application is terminated.