May 2, 2011, 5:31 a.m.
posted by yetanothergeek
What is SOAP?
SOAP (which once stood for Simple Object Access Protocol but is now known simply by its rather catchy acronym) is an important web services standard that describes the message structures passed at runtime to call a web service.
A SOAP message is an XML document that describes the operation to be performed and the parameters to pass to the application. Optionally, a SOAP message can include other information that describes how a recipient should process the SOAP message.
A SOAP message, which is always an XML message, wraps the service call in a SOAP envelope, as shown in Figure. A SOAP envelope includes an optional header area for additional processing information such as quality of service or processing restrictions that have meaning only if the service application is coded to process those headers. A SOAP envelope also includes a mandatory body section that describes the functions to be called and the parameters that are passed to the service.
SOAP structure and features
A strength of SOAP as a code wrapper is that a SOAP message is a text file that is generally passed via HTTP or HTTPS and therefore can cross corporate firewalls. Other interoperability standards such as CORBA, DCOM, and RPC cannot cross firewalls and are therefore not suitable for web services.
Figure shows a simplified representation of a SOAP request being exchanged via HTTP. The HTTP header starts with a POST request, followed by the path to the applications, /Accounts/Savings/ and the HTTP version. The second line specifies the host that is processing this request. The next two lines in the HTTP header show the SOAP HTTP binding.
The body of the HTTP request contains the SOAP message. It begins with a mandatory envelope element followed by a SOAP header containing the transaction element. This element has some meaning to the application processing the web service call but no general meaning to the SOAP standard. A body element describes the action to performnamely, depositand an account number, currency type, and amount for the action. This SOAP message allows us to pass an application instruction over the Internetnamely, to deposit $200 to account 112233 and to do it in a way that can cross corporate firewalls. This service may generate a response SOAP message that indicates success or failure.
Sample of a basic SOAP message over HTTP