Skip to main content
Omnitracs Knowledge Base

Application Specific Errors

Application Specific Errors

A very wide range of error conditions may arise from both socket issues as well as XML and web service engine issues. These are discussed in other topics in this section.

If no socket errors, XML errors, or web service engine errors arise, application-specific errors are also possible. An application-specific error assumes that the web service request was transmitted successfully over the socket, and has made it through the XML parser and the web service engine on the server side. The application code has received the web service request and begun to act on the request.

Application-specific errors are by far the most numerous, because they are solely dependent on the application programmer. Each individual web service may return any number of application-specific errors to the client.

As a generic example, consider a "Rename Vehicle" web service, which needs both the old and new vehicle ID in order to process the request. Application-specific errors can vary widely, including:

  • "Old" vehicle ID not found
  • "New" vehicle ID already exists
  • "Old" and "New" vehicle IDs are identical
  • You do not have permission to perform this action

 

WSExceptions

 

All SP web services will return application-specific errors via a "WSException" mechanism. A class of exception named WSException is defined. This class of exception will only convey application-specific errors, and will be used to convey nothing else.

For more sophisticated client platforms such as .NET, receiving this class of exception will generate an instance of a WSException class in C#, which can then be "caught" and handled using C# language tools.

For less sophisticated client platforms such as RPG, the client programmer may have to manually scan the returned XML buffer, looking for the word "WSException".

The following is an example of an application-specific error which may arise during a call to the Get Landmark Details web service. If you look at the list of exceptions at the bottom of the Get Landmark Details page, you will see the exception below defined in the list.

<soapenv:Body>

  <soapenv:Fault>

    <faultcode xmlns:p862="http://exception.sharedws">p862:WSException</faultcode>

    <faultstring>sharedws.exception.WSException: 007 Landmark cannot be found with specified information.</faultstring>

    <detail encodingStyle="">

      <p862:WSException xmlns:p862="http://exception.sharedws">

        <message>007 Landmark cannot be found with specified information.</message>

      </p862:WSException>

    </detail>

  </soapenv:Fault>

</soapenv:Body>

  • Was this article helpful?