The SOAP <Fault> element is used to carry error
and status information within a SOAP message.
If present, the SOAP <Fault> element must appear as
a body entry and must not appear more than once within a Body element. The
subelements of the SOAP <Fault> element are different
in SOAP 1.1 and SOAP 1.2.
SOAP 1.1
In SOAP 1.1, the SOAP
<Fault> element
contains the following subelements:
- <faultcode>
- The <faultcode> element is a mandatory element within
the <Fault> element. It provides information about the
fault in a form that can be processed by software. SOAP defines a small set
of SOAP fault codes covering basic SOAP faults, and this set can be extended
by applications.
- <faultstring>
- The <faultstring> element is is a mandatory element
within the<Fault> element. It provides information about
the fault in a form intended for a human reader.
- <faultactor>
- The <faultactor> element contains the URI of the SOAP
node that generated the fault. A SOAP node that is not the ultimate SOAP receiver
must include the <faultactor> element when it creates
a fault; an ultimate SOAP receiver is not obliged to include this element,
but may do so.
- <detail>
- The <detail> element carries application-specific
error information related to the <Body> element. It must
be present if the contents of the <Body> element could
not be successfully processed; it must not be used to carry information about
error information belonging to header entries - detailed error information
belonging to header entries must be carried within header entries.
SOAP 1.2
In SOAP 1.2, the SOAP
<Fault> element
contains the following subelements:
- <Code>
- The <Code> element is a mandatory element within the <Fault> element.
It provides information about the fault in a form that can be processed by
software. It contains a <Value> element and an optional <Subcode> element.
- <Reason>
- The <Reason> element is a mandatory element within
the <Fault> element. It provides information about the
fault in a form intended for a human reader. The <Reason> element
contains one or more <Text> elements, each of which contains
information about the fault in a different language.
- <Node>
- The <Node> element contains the URI of the SOAP node
that generated the fault. A SOAP node that is not the ultimate SOAP receiver
must include the <Node> element when it creates a fault;
an ultimate SOAP receiver is not obliged to include this element, but may
do so.
- <Role>
- The <Role> element contains a URI that identifies
the role the node was operating in at the point the fault occurred.
- <Detail>
- The <Detail> element is an optional element, which
contains application-specific error information related to the SOAP fault
codes describing the fault. The presence of the <Detail> element
has no significance as to which parts of the faulty SOAP message were processed.