...

Networking - SOAP

Back to Course

Lesson Description


Lession - #1367 SOAP Header


SOAP HEADER

The non-obligatory Header element gives a bendy framework for specifying additional software-degree necessities. For instance, the Header detail may be used to specify a virtual signature for password-blanketed services. Likewise, it is able to be used to specify an account variety for pay-in line with-use soap offerings.

Points to Note

  • It is an optional part of a SOAP message.
  • Header elements can occur multiple times.
  • Headers are intended to add new features and functionality.
  • The SOAP header contains header entries defined in a namespace.
  • The header is encoded as the first immediate child element of the SOAP envelope.
  • When multiple headers are defined, all immediate child elements of the SOAP header are interpreted as SOAP header blocks.

SOAP Header Attributes

A SOAP Hearder can have the following two attributes

Actor Attribute
The SOAP protocol defines a message route as a list of soap carrier nodes. Each of those intermediate nodes can perform a few processing and then forward the message to the subsequent node within the chain. Through placing the Actor characteristic, the client can specify the recipient of the cleaning SOAP header.

Must Understand Attribute
It indicates whether a Header element is optional or mandatory. If set to true, the recipient must understand and process the Header attribute according to its defined semantics, or return a fault.

The following example shows how to use a Header in a SOAP message


                            
<?xml version = "1.0"?>
<SOAP-ENV:Envelope 
   xmlns:SOAP-ENV = " "   
   SOAP-ENV:encodingStyle = " ";

   <SOAP-ENV:Header>
      <t:Transaction 
         xmlns:t = "http://www.tutorialspoint.com/transaction/" 
         SOAP-ENV:mustUnderstand = "true">5
      </t:Transaction>
   </SOAP-ENV:Header>
   ...
   ...
</SOAP-ENV:Envelope>