SOAP headers scenario

Since the document already contained SOAP header examples, I tried to
come up with a different type of usage, and to refer back to the other
examples.  If this is a lame example (not best practices), I'm open to other
suggestions.  I mainly wanted to emphasize the use of headers in intermediary
processing, since it wasn't covered elsewhere.

WSDL input tomorrow...

Mary
------------------------------------------------------------------------------------
TEXT

5.4 SOAP Headers

5.4.1 Characteristics of SOAP headers

The SOAP header is an optional element which can be used to extend SOAP
processing in an application-specific manner.  The header specification
is intentionally minimal so that headers may be tailored to meet the
needs of various applications.  As such, they may be used to convey
additional contextual information about data in the body of the SOAP
message, as illustrated elsewhere in this document.  They may also be
used to initiate or control processing of the message data, either by
the ultimate receiver of the message or by intermediary nodes which
handle the message before it is routed to the ultimate receiver.  In
this second role, SOAP headers may contain information specifying the
routing of SOAP messages and the processing which may (or must) occur
at intermediary nodes.

Although applications are encouraged to use standard, locale-neutral,
data formats, processes, and methodologies, it is sometimes necessary or
desirable to use proprietary data formats or techniques.  SOAP headers
can provide the flexibility required to process heterogeneous,
locale-sensitive, distributed data.


5.4.2 Character encoding conversion scenario

An environment exists in which related legacy applications exchange
character data with a service.  The receiving service and the senders
are not necessarily using the same character encoding scheme.  An
intermediary site receives the sender's message and, using data in the
message's SOAP header, converts the message's character data to the
encoding of the ultimate receiver, the service.


5.4.3 Scenario description

An application sends a SOAP message with character data encoded in the
character set of its local process.  The ultimate receiver of the
message is a service which processes UTF-8 data.  An intermediary
receiver examines message headers before forwarding the messages to the
ultimate receiver.  If the character encoding is not UTF-8, the
intermediary converts the data, modifies the character encoding
attribute of the message, removes the header, and forwards the message
to the ultimate receiver.


5.4.4 Scenario example

SOAP message received by intermediary:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
  <env:Header>
    <WS-I18N:convertData
       xmlns:WS-I18N="http://example.org/2002/11/21/WS-I18N"
       env:role="http://www.w3.org/2003/05/soap-envelope/role/next">
       <WS-I18N:senderEncoding>ISO-8859-1</WS-I18N:senderEncoding>
    </WS-I18N:convertData>
  </env:Header>
  <env:Body>
     . . .[legacy ISO-8859-1 data]
  </env:Body>
</env:Envelope>


SOAP message forwarded from intermediary:

<?xml version="1.0" encoding="UTF-8" ?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
  <env:Body>
     . . .[UTF-8 data]
  </env:Body>
</env:Envelope>
------------------------------------------------
Mary K. Trumble
Tel: (512) 838-0094; T/L 678-0094
mtrumble@us.ibm.com

Received on Monday, 29 March 2004 04:44:00 UTC