next up previous contents
Next: Encoding and Data Types Up: SOAP - Simple Object Previous: Message Passing   Contents


Error Handling

For a successful client-server communication, the underlying protocol has to provide extensive and extensible error handling. SOAP fulfills this task by defining a so-called ``fault message'' which includes four specific fault elements:

1. Faultcode:
This element is mandatory and describes four main types of faults17:
VersionMismatch:
The processing SOAP application found an invalid namespace for the SOAP Envelope.
MustUnderstand:
The receiving SOAP processor did not understand a header element that was intended for that application and had the ``MustUnderstand'' attribute set.
Server:
This error applies to situations where the server received a valid message but cannot process it due to a server specific error.
Client:
In this case, the SOAP message itself contains errors that make it impossible for the server to process it.
2. Faultstring:
This mandatory element contains a description of the error in human-readable text.
3. Faultactor:
As a SOAP message can travel along many nodes with several actors, this element contains the actor where the error emerged.
4. Detail:
If the error took place while the SOAP application processed the body, it has to denote this application-specific fault in this element. This element is mandatory for SOAP Body specific errors and is absent when the fault occurred during the SOAP Header processing.

Listing 6 could be a possible response to a request shown in 5 which produced an error due to a corrupted database.

language=XML
\begin{lstlisting}[caption={Example of a SOAP Fault},label=ex_soapfault]
<s:Enve...
...r:faultDetails>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
\end{lstlisting}


next up previous contents
Next: Encoding and Data Types Up: SOAP - Simple Object Previous: Message Passing   Contents
Hermann Himmelbauer 2006-09-27