Interview Questions

What is SOAP Header Element

SOAP Interview Questions and Answers


(Continued from previous question...)

What is SOAP Header Element

The SOAP Header element contains header information.
The SOAP Header Element
The optional SOAP Header element contains application-specific information (like authentication, payment, etc) about the SOAP message.
If the Header element is present, it must be the first child element of the Envelope element.
Note: All immediate child elements of the Header element must be namespace-qualified.
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.www.org/2010/12/soap-envelope"
soap:encodingStyle="http://www.www.org/2010/12/soap-encoding">

<soap:Header>
<m:Trans xmlns:m="http://www.www.org/2010/12/transaction/"
soap:mustUnderstand="1">234
</m:Trans>
</soap:Header>
...
...
</soap:Envelope>

The example above contains a header with a "Trans" element, a "mustUnderstand" attribute with a value of 1, and a value of 234.
SOAP defines three attributes in the default namespace ("http://www.www.org/2010/12/soap-envelope"). These attributes are: mustUnderstand, actor, and encodingStyle.
The attributes defined in the SOAP Header defines how a recipient should process the SOAP message.

(Continued on next question...)

Other Interview Questions