SOAP Web Service Tutorials - Herong's Tutorial Examples - Version 5.00, by Dr. Herong Yang

SOAP Communication Example

This section describes an simple example of SOAP communication.

Before going into details of the SOAP specification, let's try a very simple SOAP example. There are 3 basic steps involved in a SOAP communication:

1. Creating a SOAP message. This is easy. Just use any text editor to enter the following SOAP message, hello.msg:

<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
 <env:Header>
  <h:control xmlns:h="http://herong.com/header">
   <h:sender>Herong</h:sender>
  </h:control>
 </env:Header>
 <env:Body>
  <b:greeting xmlns:b="http://herong.com/body">
   <b:msg>Hello there!</b:msg>
  </b:greeting>
 </env:Body>
</env:Envelope>

2. Transmitting the message from a SOAP node, my machine, to another SOAP node, your machine. A simple way to do this is for me to send hello.msg to you as an email, so you will get something like this:

From: herong@my.com
To: you@your.com
Subject: Greeting

<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
 <env:Header>
  <h:control xmlns:h="http://herong.com/header">
   <h:sender>Herong</h:sender>
  </h:control>
 </env:Header>
 <env:Body>
  <b:greeting xmlns:b="http://herong.com/body">
   <b:msg>Hello there!</b:msg>
  </b:greeting>
 </env:Body>
</env:Envelope>

3. Processing the message. Once you got my SOAP message, you should be able to read it, and do whatever you want to do with it.

Last update: 2007.

Table of Contents

 About This Book

 Introduction to Web Service

Introduction to SOAP (Simple Object Access Protocol)

 What Is SOAP?

SOAP Communication Example

 SOAP Message Structure

 SOAP Message Transmission and Processing

 SOAP Data Model

 SOAP Encoding

 SOAP RPC Presentation

 SOAP Properties Model

 SOAP Message Exchange Patterns

 SOAP HTTP Binding

 SOAP Perl Implementations

 SOAP PHP Implementations

 SOAP Java Implementations

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

 Perl Socket Test Program for HTTP and SOAP

 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

 PHP SOAP Extension Client Programs

 PHP SOAP Extension Server Programs

 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

 Web Services and SOAP Terminology

 References

 PDF Printing Version

SOAP Communication Example - Updated in 2014, by Dr. Herong Yang