SOAP - Message Structure

A SOAP message is an ordinary XML document containing the following elements −

  • Envelope − Defines the start and the end of the message. It is a mandatory element.

  • Header − Contains any optional attributes of the message used in processing the message, either at an intermediary point or at the ultimate end-point. It is an optional element.

  • Body − Contains the XML data comprising the message being sent. It is a mandatory element.

  • Fault − An optional Fault element that provides information about errors that occur while processing the message.

All these elements are declared in the default namespace for the SOAP envelope − and the default namespace for SOAP encoding and data types is −

NOTE − All these specifications are subject to change. So keep updating yourself with the latest specifications available on the W3 website.

SOAP Message Structure

The following block depicts the general structure of a SOAP message −

<?xml version = "1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV = "" 
   SOAP-ENV:encodingStyle = "">