3 Structure Examples

Following is an example of how to encode a SOAP document in the SOAP data structure format by using the strings specified in section 2. White space (such as spaces, tab characters, and carriage returns) improves readability, but is not part of the encoded version of the document.

 <s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing"
             xmlns:s="http://www.w3.org/2003/05/soap-envelope">
     <s:Header>
         <a:Action s:mustUnderstand="1">action</a:Action>
     </s:Header>
     <s:Body>
         <Inventory>0</Inventory>
     </s:Body>
 </s:Envelope>

The following table divides the same SOAP document into records. Each row in the table represents one record. The first column identifies the text, or record content. The second column identifies the type of SOAP record. The third column shows the record in its encoded form. For information on the structure of each record, see [MC-NBFX].

String to encode

Record type

Encoded bytes (hex)

<s:Envelope

PrefixDictionaryElementS

56 02

xmlns:a="http://www.w3.org/2005/08/addressing"

DictionaryXmlnsAttribute

0B 01 61 06

xmlns:s="http://www.w3.org/2003/05/soap-envelope">

DictionaryXmlnsAttribute

0B 01 73 04

<s:Header>

PrefixDictionaryElementS

56 08

<a:Action

PrefixDictionaryElementA

44 0A

s:mustUnderstand="1">

PrefixDictionaryAttributeS

1E 00 82

action</a:Action>

Chars8TextWithEndElement

99 06 61 63 74 69 6F 6E

</s:Header>

EndElement

01

<s:Body>

PrefixDictionaryElementS

56 0E

<Inventory>

ShortElement

40 09 49 6E 76 65 6E 74 6F 72 79

0</Inventory>

ZeroTextWithEndElement

81

</s:Body>

EndElement

01

</s:Envelope>

EndElement

01

Several of the records contain DictionaryString entries, as specified in section 2. The bytes that map to DictionaryString entries are highlighted in bold in records 1 through 6, and in record 9.

Finally, the following diagram shows the SOAP document as a byte stream.

 56 02 0B 01 61 06 0B 01 73 04 56 08 44 0A 1E 00 
 82 99 06 61 63 74 69 6F 6E 01 56 0E 40 09 49 6E
 76 65 6E 74 6F 72 79 81 01 01
  
Show: