<div dir="ltr" style="text-align: justify;" trbidi="on">The SOAP Envelope element is the root element of a SOAP message.<br />
<b><br />
The SOAP Envelope Element</b><br />
The required SOAP Envelope element is the root element of a SOAP message. This element defines the XML document as a SOAP message. </p>
<p> The SOAP envelope indicates the start and the end of the message so that the receiver knows when an entire message has been received. The SOAP envelope solves the problem of knowing when you&#8217;re done receiving a message and are ready to process it. The SOAP envelope is therefore basic ally a packaging mechanism<br />
SOAP Envelope element can be explained as:</p>
<ul>
<li>Every SOAP message has a root Envelope element. </li>
<li>Envelope element is mandatory part of SOAP Message. </li>
<li>Every Envelope element must contain exactly one Body element. </li>
<li>If an Envelope contains a Header element, it must contain no more than one, and it must appear as the first child of the Envelope, beforethe Body. </li>
<li>The envelope changes when SOAP versions change. </li>
<li>The SOAP envelope is specified using the <i>ENV</i> namespace prefix and the <i>Envelope</i> element. </li>
<li>The optional SOAP encoding is also specified using a namespace name and the optional <i>encodingStyle</i> element, which could also point to an encoding style other than the SOAP one. </li>
<li>A v1.1-compliant SOAP processor will generate a fault when receiving a message containing the v1.2 envelope namespace. </li>
<li>A v1.2- compliant SOAP processor generates a <i>VersionMismatch</i> fault if it receives a message that does not include the v1.2 envelope namespace. </li>
</ul>
<div align='center' id="ads-id"></div>
<p><b>Example for v1.2 is given below-</b></p>
<pre class="highlight" name="code"><;?xml version="1.0"?>;
<;soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">;
 ...
 Message information goes here
 ...
<;/soap:Envelope>; 
</pre>
<p><b>The <i>xmlns:soap</i> Namespace</b></p>
<p> Notice the xmlns:soap namespace in the example above. It should always have the value of: &#8220;<b><i>http://www.w3.org/2001/12/soap-envelope</i></b>&#8220;.</p>
<p> The namespace defines the Envelope as a SOAP Envelope.</p>
<p> If a different namespace is used, the application generates an error and discards the message.<br />
<b>The <i>encodingStyle </i>Attribute</b></p>
<p> The <i><b>encodingStyle </b></i>attribute is used to define the data types used in the document. This attribute may appear on any <i><b>SOAP </b></i>element, and applies to the element&#8217;s contents and all child elements.</p>
<p> A <i><b>SOAP </b></i>message has no default encoding.</p>
<p>Following example illustrates the use of a <b><i>SOAP </i></b>message within an<b><i> HTTP POST</i></b> operation, which sends the message to the server. It shows the namespaces for the envelope schema definition and for the schema definition of the encoding rules. The <i><b>OrderEntry </b></i>reference in the <b><i>HTTP </i></b>header is the name of the program to be invoked at the <b><i>dineshonjava.com</i></b> Web site.</p>
<pre class="highlight" name="code">POST /OrderEntry HTTP/1.1
Host: dineshonjava.com
Content-Type: application/soap; charset="utf-8"
Content-Length: nnnn
<;?xml version="1.0"?>;
<;SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2001/12/soap-envelope"
SOAP-ENV:encodingStyle="http://www.w3.org/2001/12/soap-encoding">;
 ...
 Message information goes here
 ...
<;/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-message-structure.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-header-element.html">Next</a> >;>;</b></div>
<p>
</div>
<div class="wp-post-navigation"> 
									 <div class="wp-post-navigation-pre"> 
									 <a href="https://dineshonjava.com/web-service-introduction/">Previous</a> 
									 </div> 
									 <div class="wp-post-navigation-next"> 
									 <a href="https://dineshonjava.com/soap-header-element/">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: '445'});
});
</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…