Optional SOAP The optional SOAP Header element can contain application-specific information about SOAP messages (such as authentication, payments, and so on). If Note: all The above example contains a header with a “Trans” element with a value of 234. the value of the “mustUnderstand” attribute of this element is “1”. SOAP is in the default namespace (” http://www.w3.org/2001/12/soap-envelope ”) defines three attributes.” These three attributes are: The mustUnderstand property of SOAP can be used to identify whether the title item is mandatory or optional for the recipient to process it. If you add “mustUnderstand=” 1 “to a child element of the Header element,it indicates that the recipient processing the header must recognize the element. If the recipient cannot recognize the element, it must fail to process the header. SOAP messages can be propagated from a sender to a receiver by passing through different endpoints along the message path. Not all parts of the SOAP message are intended to be delivered to the final endpoint of the SOAP message, but on the other hand, it may be intended to be delivered to one ormore endpoints on the message path. SOAP’s SOAP’s There is no default encoding for SOAP messages.
Header
element contains header information. 3.5.1. SOAP Header element ¶
Header
element is provided, it must be a
Envelope
the first child of the element.
Header
the immediate child element of the element must be a qualified namespace.<?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">
<soap:Header>
<m:Trans xmlns:m="http://www.w3schools.com/transaction/"
soap:mustUnderstand="1">234
</m:Trans>
</soap:Header>
...
...
</soap:Envelope>
actor
、
mustUnderstand
and
encodingStyle
. These properties, defined in the SOAP header, define howthe container handles SOAP messages. 3.5.2. MustUnderstand attribute ¶
Grammar ¶
soap:mustUnderstand="0|1"
Example ¶
<?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">
<soap:Header>
<m:Trans xmlns:m="http://www.w3schools.com/transaction/"
soap:mustUnderstand="1">234
</m:Trans>
</soap:Header>
...
...
</soap:Envelope>
3.5.3. Actor attribute ¶
actor
property can be used to set the
Header
element is addressed to a specific endpoint.Grammar ¶
soap:actor="*URI*"
Example ¶
<?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">
<soap:Header>
<m:Trans xmlns:m="http://www.w3schools.com/transaction/"
soap:actor="http://www.w3schools.com/appml/">234
</m:Trans>
</soap:Header>
...
...
</soap:Envelope>
3.5.4. EncodingStyle attribute ¶
encodingStyle
property is used to define the data type used in the document. This attribute can appear in any SOAP element and is applied to the contents of the element and to all child elements of the element.Grammar ¶
soap:encodingStyle="*URI*"