Easy Tutorial
❮ Index Soap Syntax ❯

SOAP Header Element


The optional SOAP Header element contains header information.


SOAP Header Element

The optional SOAP Header element can contain application-specific information related to the SOAP message (such as authentication, payment, etc.).

If the Header element is provided, it must be the first child element of the Envelope element.

Note: All direct child elements of the Header element must be qualified with a namespace.

The example above includes a header with a "Trans" element, whose value is 234, and the "mustUnderstand" attribute of this element is set to "1".

SOAP defines three attributes in the default namespace ("http://www.w3.org/2001/12/soap-envelope"): actor, mustUnderstand, and encodingStyle. These attributes defined in the SOAP header specify how the container should process the SOAP message.


mustUnderstand Attribute

The mustUnderstand attribute in SOAP can be used to identify whether a header item is mandatory or optional for the recipient processing it.

If you add "mustUnderstand="1"" to a child element of the Header element, it indicates that the recipient processing this header must acknowledge this element. If this recipient cannot acknowledge this element, it must fail when processing this header.

Syntax

Example


actor Attribute

SOAP messages can propagate from a sender to a receiver through different endpoints along the message path. Not all parts of a SOAP message are intended to be delivered to the final endpoint of the SOAP message; however, some parts may be intended for one or more endpoints on the message path.

The actor attribute in SOAP can be used to address the Header element to a specific endpoint.

Syntax

Example


encodingStyle Attribute

The encodingStyle attribute in SOAP is used to define the data types used in the document. This attribute can appear in any SOAP element and is applied to the element's content and all its child elements.

SOAP messages do not have a default encoding method.

Syntax

❮ Index Soap Syntax ❯