Quantcast

After giving an introduction to SOAP in the previous article, in this article, we would discuss some important elements and attributes of SOAP. We start with the header element. The SOAP Header element contains application-specific information (like authentication, payment, etc) about the SOAP message. The header element should be the first child element of the Envelope element and all immediate child elements of the Header element must be namespace-qualified. Consider the following piece of code:

The example above contains a header with a “Trans” element, a “mustUnderstand” attribute with a value of 1, and a value of 234. The attributes defined in the SOAP Header defines how a recipient should process the SOAP message.

An important attribute is the SOAP mustUnderstand attribute which can be used to indicate whether a header entry is mandatory or optional for the recipient to process. If you add mustUnderstand=”1″ to a child element of the Header element it indicates that the receiver processing the Header must recognize the element. If the receiver does not recognize the element it will fail when processing the Header. It’s syntax is:

soap:mustUnderstand=”0|1″

An example:

A SOAP message may travel from a sender to a receiver by passing different endpoints along the message path. However, not all parts of a SOAP message may be intended for the ultimate endpoint, instead, it may be intended for one or more of the endpoints on the message path. The SOAP actor attribute is used to address the Header element to a specific endpoint. Its syntax is:

soap:actor=”URI

Consider an example:

The following line in the above code:

soap:actor=”http://www.gmail.com/appml/”>234

is used to address the Header element to the desired endpoint.

Looking for a quality hosting service? here are a few I suggest.
BlueHost | HostGator | Media Temple
Admin
Admin
Ali has been an entrepreneur in web, video and related technologies. Having worked with many business across the globe, Ali stands truly a great pillar in the business working with him.