REST Fault Handling
On failure, various HTTP status codes can be returned depending on the failure and where the failure occurred during processing. VoiceCheck makes use of the Apache® CXF framework for processing web services requests, and the framework can return errors during its processing such as 406 – Not Acceptable, or 415 – Unsupported Media Type, before the VoiceCheck business logic is reached.
Errors coming from the VoiceCheck business logic only have one of two status codes:
- 400 – Bad Request: The client has violated a business rule or constraint (usually bad data). Sending the message again without making a change to the content will result in the same error.
- 500 – Internal Server Error: There was an internal server error while processing the request. Retrying the message MAY result in success.
Also, errors coming from the VoiceCheck business logic include a faultInfo XML element containing additional information about the error that occurred. The properties of the faultInfo element are shown below.
SOAP Fault Handling
SOAP 1.1 faults are returned for all errors. All faults contain a faultcode and faultstring as specified in SOAP 1.1. Two of the core SOAP 1.1 fault codes, Client and Server, are specified for most faults. VoiceCheck generally uses these codes in the manner described in the SOAP 1.1 specification.
There are errors that can occur during authentication that use fault codes specified in WS-Security (Web Services Security). The Java web services APIs and implementations may return other fault codes.
While it is not possible to list every fault code that may occur, there are general rules that can enable consistent handling of faults by web services clients:
- Fault codes other than Server typically mean that there is no point in automatically resending the message. They are sent when the client has done something wrong prior to the transmission reaching the application logic on the server, such as authentication failures or badly formed messages.
- When the fault code is Server, if the fault is coming from the application server logic, it will include the SOAP 1.1 fault detail element. The format is specified in the WSDL, but contains the information in the section below.
Fault Info Element
Both REST and SOAP web services include the same error information when a fault comes from the VoiceCheck application server logic.
The host server REST implementation for post assignment results should use this fault info element in order to display the error message in the VoiceCheck GUI; otherwise, the user sees a generic message.
errorCode |
long |
Numeric code representing the error.
Valid values:
3000 = Internal server error (request may or may not succeed on retry)
3001 = Bad request (automated request retry is not recommended)
|
message |
string |
Human readable message explaining the error. |