<header> element

SOAP/AM Server Development > Service Definition File Reference > Schema Reference >

<header> element

Previous pageReturn to chapter overviewNext page

This element defines a SOAP header that may be included in the SOAP envelope. The header's content is mapped to an element of the server request message or from an element of the server reply message by using a <mapping> element.

 

parents

headers

children

none

Attributes

attribute name

data type

usage

default value

description

 

direction

xsd:token

required

 

The direction in which the header travels in the SOAP envelope. Must be one of: "in", "in/out" or "out". If "in", you must define a mapping> to an element of the request message. If "out", you must define a <mapping> from an element of the reply message. If "in/out", you must define both mappings.

 

name

xsd:NCName

required

 

The header name; corresponds to the header name in the SOAP envelope and the "name" attribute of a <mapping> element. Must be unique within <headers> and <parameters>.

 

type

xsd:NCName

required

 

The type of data for this header in the SOAP envelope. It may be one of the built-in types or a <type> defined in <types>.

Remarks

If the <header> name = "txControl", no <mapping> is required. The txControl header is used to control transactions with SOAP/AM Server. See Controlling Transactions for more information. txControl headers must of type "txControl".

 

If you fail to define a corresponding <mapping> for a <header>, a SOAP fault will occur at runtime.

 

At runtime, if the expected "in" header is not present in the SOAP request envelope, the associated <mapping> will not be executed. The same behavior applies to "in/out", but the response header is generated nonetheless.

 

If the SOAP request envelope contains a header with the standard "mustUnderstand" attribute set to "True", a SOAP fault will occur if the corresponding <header> has not been defined.

Example

<method ... >

 <headers>

   <header name="txControl" type="txControl" direction="in/out"/>

   <header name="my-context-info" type="my-context-type" direction="in/out"/>

 </headers>

...

 <request ... >

   <mappings>

     <mapping name="my-context-info" element="context"/>

     </mapping>

   </mappings>

 </request>

 

 <replies>

   <reply ... >

     <mappings>

       <mapping name="my-context-info" element="context"/>

       </mapping>

     </mappings>

   </reply>

 </replies>

 

</method>