3.2.4 Generating and Parsing Messages

After the connection has been established and authentication and content type negotiation has been completed, the client and server know whether encryption, compression and binary XML are enabled for requests and responses.

To generate a message, the following steps MUST be followed.

TCP

  1. Generate the SOAP envelope.

  2. If binary XML is enabled, encode the SOAP message as described in 2.1.5 and [MS-BINXML]. Otherwise, encode the SOAP message in text XML.

  3. If compression is enabled, compress the message as described in Compression. The message can be divided into multiple compression data blocks.

  4. If encryption is enabled, encrypt the message using GSS-API. The message can be divided into multiple encryption data blocks.

  5. Compose the message into DIME records and send it via TCP. The message can be divided into multiple DIME records.

HTTP/HTTPS

  1. Generate the SOAP envelope.

  2. If binary XML is enabled, encode the SOAP message as described in 2.1.5 and [MS-BINXML]. Otherwise, encode the SOAP message in text XML.

  3. If compression is enabled, compress the message as described in Compression. The message can be divided into multiple compression data blocks.

  4. Send the message via HTTP/HTTPS along with the appropriate HTTP headers.

To parse a message, the following steps MUST be followed.

TCP

  1. Combine all the DIME records into a single data block.

  2. If encryption is enabled, decrypt all the encryption data blocks and combine them into a single decrypted data block.

  3. If compression is enabled, decompress all the compression data blocks as described in Compression, and then combine them into a single decompressed data block.

  4. If binary XML is enabled, decode the data block as described in 2.1.5 and [MS-BINXML]. Otherwise, decode the data block as text XML.

  5. Parse the SOAP envelope.

HTTP/HTTPS

  1. If compression is enabled, decompress all the compression data blocks as described in Compression, and then combine them into a single decompressed data block.

  2. If binary XML is enabled, decode the data block as described in 2.1.5 and [MS-BINXML]. Otherwise, decode the data block as text XML.

  3. Parse the SOAP envelope.