<div dir="ltr" style="text-align: justify;" trbidi="on">When 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.<br />
The SOAP fault mechanism returns specific information about the error, including a predefined code, a description, the address of the SOAP processor that generated</p>
<ul>
<li>A SOAP Message can carry only one fault block </li>
<li>Fault element is an optional part of SOAP Message </li>
<li>For the HTTP binding, a successful response is linked to the 200 to 299 range of status codes; </li>
<li>SOAP fault is linked to the 500 to 599 range of status codes. </li>
</ul>
<p>The SOAP Fault element has the following sub elements:</p>
<table border="1">
<tbody>
<tr>
<th align="left" valign="top" width="25%">Sub Element</th>
<th align="left" width="75%">Description</th>
</tr>
<tr>
<td valign="top"><i><b><;faultcode>;</b></i></td>
<td>A code for identifying the fault</td>
</tr>
<tr>
<td valign="top"><i><b><;faultstring>;</b></i></td>
<td>A human readable explanation of the fault</td>
</tr>
<tr>
<td valign="top"><i><b><;faultactor>;</b></i></td>
<td>Information about who caused the fault to happen</td>
</tr>
<tr>
<td valign="top"><i><b><;detail>;</b></i></td>
<td>
<div class="MsoNormal">Holds application specific error information related to the Body element</div>
</td>
</tr>
</tbody>
</table>
<div align='center' id="ads-id"></div>
<p><b><br />
SOAP Fault Codes</b><br />
The <i><b>faultcode </b></i>values defined below must be used in the <b><i>faultcode </i></b>element when describing faults:</p>
<table border="1">
<tbody>
<tr>
<th align="left" valign="top" width="25%">Error</th>
<th align="left" width="75%">Description</th>
</tr>
<tr>
<td valign="top"><i><b>VersionMismatch</b></i></td>
<td>Found an invalid namespace for the SOAP Envelope element</td>
</tr>
<tr>
<td valign="top"><i><b>MustUnderstand</b></i></td>
<td>An immediate child element of the Header element, with the <i><b>mustUnderstand</b></i> attribute set to &#8220;1&#8221;, was not understood</td>
</tr>
<tr>
<td valign="top"><i><b>Client</b></i></td>
<td>The message was incorrectly formed or contained incorrect information</td>
</tr>
<tr>
<td valign="top"><i><b>Server</b></i></td>
<td>There was a problem with the server so the message could not proceed</td>
</tr>
</tbody>
</table>
<p>
<b>SOAP Fault Example</b></p>
<p> The following code is a sample Fault. The client has requested a method named <i><b>ValidateCreditCard </b></i>, but the service does not support such a method. This represents a client request error, and the server returns the following SOAP response:</p>
<pre class="highlight" name="code"><;?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:Client<;/faultcode>;
 <;faultstring xsi:type="xsd:string">;
 Failed to locate method (ValidateCreditCard) in class
 (examplesCreditCard) at /usr/local/ActivePerl-5.6/lib/
 site_perl/5.6.0/SOAP/Lite.pm line 1555.
 <;/faultstring>;

 <;/SOAP-ENV:Fault>;
 <;/SOAP-ENV:Body>;
<;/SOAP-ENV:Envelope>;
</pre>
<p><i><b>References</b></i><br />
1. <i><b><a href="http://en.wikipedia.org/wiki/SOAP" target="_blank">Wikipedia for SOAP</a></b></i></p>
<p> ; </p>
<div style="background-color: pink; border-width: thin; text-align: center;"><b><;<;<a href="https://dineshonjava.com/2013/05/soap-body-element.html">Previous</a> <;<; ; ; || <a href="https://dineshonjava.com/2013/01/core-java-baby-step-to-be-best-java-ian.html">Index </a>||  ; >;>;<a href="https://dineshonjava.com/2013/05/soap-encoding.html">Next</a> >;>;</b></div>
<p>
</div>
<div class="wp-post-navigation"> 
									 <div class="wp-post-navigation-pre"> 
									 <a href="https://dineshonjava.com/soap-body-element/">Previous</a> 
									 </div> 
									 <div class="wp-post-navigation-next"> 
									 <a href="https://dineshonjava.com/soap-encoding/">Next</a> 
									 </div> 
									</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
 $.post('https://dineshonjava.com/wp-admin/admin-ajax.php', {action: 'mts_view_count', id: '442'});
});
</script>
Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…
Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…
Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…
Technology has emerged a lot in the last decade, and now we have artificial intelligence;…
Managing a database is becoming increasingly complex now due to the vast amount of data…
Overview In this article, we will explore Spring Scheduler how we could use it by…