c-- styles for logos and headline links do not modify internet, red, or black styles -->

Intranet Journal   Earthweb  
Events Jobs Premium Services Media Kit Network Map E-mail Offers Vendor Solutions Webcasts

   Intranet Journal Subjects
Search Earthweb

Privacy Policy



internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

internet commerce
Be a Commerce Partner
















 

[ Home | Discussion Forum | How Do I... | Lotus Notes Intranets | Microsoft SharePoint | Products | Shopping  ]

free news!

SOAP: Simple Object Access Protocol

William Bordes, R&D Consultant (wbordes@techmetrix.net)
and
Johann Dumser, Junior Consultant
(jdumser@techmetrix.net)

Printer Friendly Version

Architecture - Operation

Principles of operation

SOAP is a lightweight specification protocol used to invoke methods on servers, components and objects so as to exchange information in a decentralized, distributed environment. This XML-based protocol, transported by HTTP, can be broken down into three parts:

  • The structure of the SOAP envelope (Payload) defines a general structure expressing the content, processing party and optional/ mandatory nature of a message.
  • The SOAP encoding rules define a serialization mechanism that can be used to exchange instances of application-defined datatypes.
  • Soap's Remote Protocol Call defines a convention, which can be used to represent remote procedure calls and their responses.

The XML part of every SOAP message contains particular tags and attributes. It consists of:

  • The SOAP envelope: this is the first element in the XML document representing the message.
  • The (optional) SOAP header: this is a generic mechanism that adds characteristics to the SOAP message. SOAP defines several attributes that can be used to indicate who must process the characteristics, and whether this process is optional or mandatory.
  • The SOAP body: this is the container for the mandatory information being sent to the message endpoint.

XML Structure

SOAP Envelope
This is the first part of the SOAP message and it is mandatory. It contains the name of the element (Envelope), followed by a namespace defining the SOAP version being used, and the optional encodingStyle attribute which points to a link where the serialization (tree structure) and encoding rules are defined. The envelope is presented as follows:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xml.org/soap/envelope/" SOAP-ENV
:encodingStyle="http://schemas.xml.org/soap/
encoding/"/> … </SOAP:Envelope>

Namespaces are used to provide a context and guarantee the uniqueness of elements associated in this way.

SOAP Header
This is an optional part of the SOAP message encapsulated in the SOAP envelope. It carries information to intermediaries, and is made up of one of more entries. These bear a local name, a full name, a namespace and the two actor attributes which designate the endpoint of the entry, and mustUnderstand, which indicates the optional nature of the process. A SOAP application must include a correct SOAP namespace for all the elements and attributes defined in the message generated. This is a URI which points to a description of the message information in order to guarantee the uniqueness of the message. DTDs are never used.

<SOAP-ENV:Header>
<t:newEvent xmlns:t="http://www.techmetrix.com/
eventmanager"
SOAP-ENV :actor="http://schemas.xml.org/soap /actor/next/" SOAP-ENV :mustUnderstand="1"> Christmas Event
</t:newEvent>
</SOAP-ENV:Header>

SOAP Body
The information to be processed by the endpoint is found in the body of the SOAP message. This can contain a set of entries which are all kept in the root of the message body.

<SOAP-ENV:Body>
<m:NewCustomer xmlns:m="Some-URI">
<Name>Dumser</Name>
<Surname>Johann</Surname>
<City>Cambridge</City>
<ZipCode>01800</ZipCode>
<State>MA</State>
<Country>USA</Country>
</m:NewCustomer>
</SOAP-ENV:Body>

The http protocol is used so that the SOAP message will be transported effectively.

HTTP Structure

HTTP Header
The HTTP header is found just before the SOAP message. The HTTP protocol sends a POST request via the network. The code lines are as follows:

In the first line, the send method, URI request and protocol version are defined:

POST /Computer HTTP/1.1

The next line gives the target site:

Host: www.techmetrix.com

The next three lines are used to define the MIME format for message display, the HTTP coding and the length of the message.

Content-Type: text/xml;
charset="utf-8"
Content-Length: 10

Then, methods are added such as SOAPAction (a.k.a. SOAPMethodName) which determines the intention of the HTTP request. The identifier following the # sign must match the name of the first tag in the SOAP message body.

SOAPAction="http://www.techmetrix.com#EventManager"

SOAP Structure

Below is an example of the SOAP message request code, followed by an explanatory diagram:

POST /EventManager HTTP/1.1
Host: www.techmetrix.com
Content-Type: text/xml;
charset="utf-8"

Content-Length: 60 SOAPAction="http://www.techmetrix.com/Event
#New Customer"

<SOAP-ENV:Envelope xmlns:SOAP-ENV=" http://schemas.xml.org/soap/envelope/"
SOAP-ENV :encodingStyle="http://schemas.xml.org/soap/
encoding/"/> <SOAP-ENV:Header>
<t:Name
xmlns:t="www.techmetrix.com/EventManager"
SOAP-ENV :actor="http://schemas.xml.org/soap/actor /next/" SOAP-ENV :mustUnderstand="1"> Dumser
</t:Name >
</SOAP-ENV:Header>
<SOAP:Body> <m:NewCustomer xmlns:m="www.techmetrix.com/Event"> <Entreprise>SQLI</Entreprise>
<Address>Paris</Address> </m:NewCustomer> </SOAP:Body>
</SOAP:Envelope>

Basic structure of a SOAP message

Printer Friendly Version

TechMetrix

TechMetrix Research is a technically focused analyst firm focused on e-business application development needs. Based in Boston, Mass., the firm publishes comparison reports and product reviews designed to aid enterprises with decision making and to keep pace with the fast-moving e-business market.

TechMetrix is a U.S.-based subsidiary of SQLI, a European company that offers on-site development services to international organizations. SQLI specializes in e-business project development.



Of Interest
· More Intranet Corner

· Express Yourself