SOAP Generic Message Structure

This section provides a description of the SOAP generic message structure and a sample message.

A SOAP message is an XML document with "Envelope" as the root element with the following structure:

<env:Envelope xmlns:env="">

where "Header" is an optional child element, and "Body" is a required child element.

A "Header" element may contain zero or more "Header Block" elements with the following structure:

  <hb0:headBlock0 xmlns:hb0="Uri0">
  <hbN:headBlockN xmlns:hbN="UriN">

A "Header Block" element must have a name space. It may contain text information and any number of child elements. It may also contain any number of attributes including SOAP predefined attributes. A "Header Block" has the following structure:

  <hb:headBlock xmlns:hb="Uri">
   <hb:child0 encodingStyle="..." role="..." mustUnderstand="..."
    relay="..." ...>
   <hb:childN encodingStyle="..." role="..." mustUnderstand="..."
    relay="..." ...>

"encodingStyle", "role", "mustUnderstand" and "relay" are SOAP predefined attributes. We will discuss them later.

A "Body" element has almost no restrictions. It may have text information, any number of attributes and any number of child elements, with the following structure:

 <env:Body ...>
  <bodyChild0 ...>
  </bodyChild0 ...>
  <bodyChildN ...>
  </bodyChildN ...>

To give an idea of how a SOAP message looks like, I have copied the example #1 from the SOAP 1.2 specification here:

<?xml version="1.0"?>
<env:Envelope xmlns:env="">
  <m:reservation xmlns:m=""
  <n:passenger xmlns:n=""
   <n:name>Herong Yang</n:name>
     <p:departing>New York</p:departing>
     <p:arriving>Los Angeles</p:arriving>
     <p:departureTime>late afternoon</p:departureTime>
     <p:departing>Los Angeles</p:departing>
     <p:arriving>New York</p:arriving>

Table of Contents

 About This Book

 Introduction to Web Service

 Introduction to SOAP (Simple Object Access Protocol)

SOAP Message Structure

SOAP Generic Message Structure

 SOAP Fault Message Structure

 SOAP Message Transmission and Processing

 SOAP Data Model

 SOAP Encoding

 SOAP RPC Presentation

 SOAP Properties Model

 SOAP MEP (Message Exchange Patterns)

 SOAP HTTP Binding

 SOAP PHP Implementations

 PHP SOAP Extension Client Programs

 PHP SOAP Extension Server Programs

 PHP SOAP Web Service Example - getTemp

 SOAP Perl Implementations

 Perl SOAP::Lite - SOAP Server-Client Communication Module

 Perl Socket Test Program for HTTP and SOAP

 Perl SOAP::Lite for NumberToWords SOAP 1.1 Web Service

 Perl SOAP::Lite for SOAP 1.2 Web Services

 Perl SOAP::Lite for WSDL

 Python SOAP Client: Zeep

 SOAP Java Implementations

 Java Socket and HttpURLConnection for SOAP

 SAAJ - SOAP with Attachments API for Java

 SoapUI - SOAP Web Service Testing Tool

 WS-Security - SOAP Message Security Extension

 WS-Security X.509 Certificate Token

 Perl SOAP::Lite for GetSpeech SOAP 1.1 Web Service

 Perl SOAP::Lite 0.710 for SOAP 1.2 Web Services

 Perl SOAP::Lite 0.710 for WSDL

 Web Services and SOAP Terminology

 Archived Tutorials


 Full Version in PDF/EPUB