- SOAP - Standards
- SOAP - Examples
- SOAP - Transport
- SOAP - Encoding
- SOAP - Fault
- SOAP - Body
- SOAP - Header
- SOAP - Envelope
- SOAP - Messages
- SOAP - What is SOAP?
- SOAP - Home
SOAP Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
SOAP - Fault
If an error occurs during processing, the response to a SOAP message is a SOAP fault element in the body of the message, and the fault is returned to the sender of the SOAP message.
The SOAP fault mechanism returns specific information about the error, including a predefined code, a description, and the address of the SOAP processor that generated the fault.
Points to Note
A SOAP message can carry only one fault block.
Fault is an optional part of a SOAP message.
For HTTP binding, a successful response is pnked to the 200 to 299 range of status codes.
SOAP Fault is pnked to the 500 to 599 range of status codes.
Sub-elements of Fault
The SOAP Fault has the following sub elements −
Sr.No | Sub-element & Description |
---|---|
1 | <faultCode> It is a text code used to indicate a class of errors. See the next Table for a psting of predefined fault codes. |
2 | <faultString> It is a text message explaining the error. |
3 | <faultActor> It is a text string indicating who caused the fault. It is useful if the SOAP message travels through several nodes in the SOAP message path, and the cpent needs to know which node caused the error. A node that does not act as the ultimate destination must include a faultActor element. |
4 | <detail> It is an element used to carry apppcation-specific error messages. The detail element can contain child elements called detail entries. |
SOAP Fault Codes
The faultCode values defined below must be used in the faultcode element while describing faults.
Sr.No | Error & Description |
---|---|
1 | SOAP-ENV:VersionMismatch Found an invapd namespace for the SOAP Envelope element. |
2 | SOAP-ENV:MustUnderstand An immediate child element of the Header element, with the mustUnderstand attribute set to "1", was not understood. |
3 | SOAP-ENV:Cpent The message was incorrectly formed or contained incorrect information. |
4 | SOAP-ENV:Server There was a problem with the server, so the message could not proceed. |
SOAP Fault Example
The following code is a sample Fault. The cpent has requested a method named VapdateCreditCard, but the service does not support such a method. This represents a cpent request error, and the server returns the following SOAP response −
<?xml version = 1.0 encoding = UTF-8 ?> <SOAP-ENV:Envelope xmlns:SOAP-ENV = "http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi = "http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd = "http://www.w3.org/1999/XMLSchema"> <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode xsi:type = "xsd:string">SOAP-ENV:Cpent</faultcode> <faultstring xsi:type = "xsd:string"> Failed to locate method (VapdateCreditCard) in class (examplesCreditCard) at /usr/local/ActivePerl-5.6/pb/site_perl/5.6.0/SOAP/Lite.pm pne 1555. </faultstring> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope>Advertisements