What is XML SOAP Protocol. Structure of SOAP.

Leave a Comment

Simple Object Access Protocol(SOAP) is a protocol based on XML. It is used by the web services for exchange of information. It is a W3C recommendation.

This exchange of information is done over HTTP. This is a platform and language independent protocol.

The client-server communication is based on RPC. The HTTP does not designed to handle the distributed objects that are required by the RPC. Hence another application protocol is build over HTTP which popularly known as SOAP. SOAP allows to talk different applications that are running in two different operating systems.

Structure of SOAP

The structure of the SOAP is defined by four building blocks
Structure of the SOAP


#1. Envelop

The Envelop is the root of any SOAP document. It identifies that the XML document as a SOAP message. It defines two things - Namespace and encodingStyle. The Namespace value can be given as -
xmlns:soap="http://www.w3.org/2001/12/soap-envelope".

The encoding style is useful to define the data types used in the document. For example the value of encoding can be given as-
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"

#2. Header

The SOAP header field is optional. It contains the header information. The header contains three attributes such as mustUnderstand, actor and encodingStyle.

The mustUnderstand attribute specifies 0 or 1. If the value is 1 then it means that the receiver should process the header.

Normally the SOAP message travels over a message path having the endpoints at the two ends. The SOAP actor is used to specify the URI for this document.

The SOAP header defines how the recipient should process the SOAP message.

#3. Body

The required SOAP Body element contains the actual SOAP message intended for the ultimate endpoint of the message.

#4. Fault

This is optional element ofthe SOAP message. It is used to represent the error code. It consists of elements such as faultcode which is a code for fault. The faultstring message gives the details about the fault.

0 comments:

Post a Comment