You want to deal with a web service that has returned a SOAP fault to your SAAJ client.
Use the SAAJ fault classes to work with the data.
When a web service provider throws an exception or error, a SOAP fault is generated. This bears obvious similarity to exceptions in Java, such as details regarding the exception, human-readable explanations, and codes.
But there are a number of differences to be aware of. To begin with, there is no linguistic structural mechanism surrounding the use of faults as there is with Java exceptions. That is, there is no try-catch mechanism. A fault replaces the body content of the SOAP response; therefore, the body element must contain the fault as its only child. Clients must then be prepared to read a fault from the body in much the same way they are prepared to read the data expected on a successful invocation. What this means is that the fault is simply data in SOAP. It cannot reroute or stop processing the way a Java exception can. It is just a message, the same as anything else.
If the message exchange is request-reply, the fault message is
returned to the caller as a type of
soap:Fault. If the
invocation is one-way, the fault is not returned to the caller.
The only possible child elements of
SOAP 1.1 are the following:
A required element. It provides a human-readable explanation of the fault.
A required element in the event that an actor is specified. If no ...