Intranet Journal
The online resource for intranet professionals
William Bordes, R&D
Consultant
(wbordes@techmetrix.net)
and
Johann Dumser, Junior Consultant
(jdumser@techmetrix.net)
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 XML part of every SOAP message contains particular tags and attributes. It consists of:
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.
|
|
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; |
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> |

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.