SOAP Message Document

A SOAP Message is an ordinary XML document that consists of the following parts:

  • A mandatory SOAP envelope.

  • An optional SOAP header.

  • A mandatory SOAP body.

SOAP Message Part


SOAP Envelope

Is the top element of the XML document representing the message. It defines the content of the message, as well as the framework of what is in a message, how to process it, who should deal with it and whether it is optional or mandatory.

SOAP Header

Contains header information, and attributes that can be set to encode and further identify the type of processing as well as additional features of the message. This portion is optional.


Contains the call and response information intended for the recipient of the message. A SOAP Fault element can appear in the body of the SOAP message to carry error or status information.

Image: SOAP parts in an XML document

The following image illustrates SOAP parts in an XML document.

SOAP parts in an XML document

The following are required for a SOAP message:

  • Encoded using XML.

  • Have a SOAP envelope.

  • Have a SOAP body.

  • Use the SOAP encoding and envelope namespaces.

The following are optional for a SOAP message:

  • SOAP Header.

  • XML Schema use.

The following are invalid for a SOAP message:

  • DTD references.

  • XML Processing Instructions.

  • XML CData Sections.