When a Web service operation fails after the request arrives at the Web service, it might generate a SOAP fault. This is a special SOAP response message that contains a single fault element in the body, and a namespace qualified and usually identified by a <SOAP:Fault> or <SOAP-ENV:Fault> tag. This is a typical SOAP fault message, with the most common SOAP fault elements:
Sample SOAP fault message
<SOAP-ENV:Body>
<SOAP-ENV:Fault> <faultcode>VersionMismatch.Additionalinfo</faultcode> <faultstring>The message does not conform to expected
version</faultstring> <faultactor>http://www.stockvendor.com</faultactor> <detail> <e:badver xmlns:e=http://www.stockvendor.com/>
<message>Expect version 2 request, received previous
version</message>
<errorcode>523</errorcode>
</e:badver>
</detail> </SOAP-ENV:Fault> </SOAP-ENV:Body>
These three child elements of this SOAP fault are mostly application-defined, but typically provide the following information:
<faultcode> — Coded fault identifier, such as an error number or specially formatted string to identify the fault.
<faultstring> — Single string value containing a simple description of the fault.
<faultactor> — (Optional) Single string value identifying the Universal Resource Identier (URI) of the Web service that caused the fault. This is less common, as it is usually apparent what Web service has generated the SOAP fault.
<detail> — (Optional) Contains elements completely defined by the Web service, but which provide much more specific information about the fault.