Project Home | Progress | Seminars | Reports | References | Contact

Anatomy of a SOAP Message

<SOAP-ENV:Envelope>

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding"

<SOAP-ENV:Header>
....
</SOAP-ENV:Header>

<SOAP-ENV:Body>
....
</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

The SOAP Envelope

The SOAP envelope is a mandatory element which encapsulates a SOAP message. It must contain a SOAP body element although a SOAP header is optional.

The SOAP Header

The SOAP header is an optional element which can contain information needed to successfully process the data in the SOAP body. For example, the SOAP header could convey authentication, security or versioning information, which would otherwise be inappropriate to be included in the SOAP Body.

The SOAP Body

The SOAP Body contains the information being conveyed by the SOAP Message. It could be an RPC Call or just a simple message. SOAP Faults, which are exceptions thrown by the service provider, are also conveyed through the SOAP Body. The SOAP Specification describes how an RPC call is mapped into the XML Structure of a SOAP Message.