Close

SOAP

[Last Updated: Dec 8, 2016]

Web Services SOAP 

SOAP stands for Simple Object Access Protocol.

This standard protocol allows different systems, using different technologies to communicate with each other. It is platform and language independent.

SOAP relies exclusively on XML to provide messaging services. It defines the XML-based message format that Web service-enabled applications use to communicate and inter-operate with each other over the Web.

SOAP was originally designed to take the place of older technologies that don't work well on the Internet such as the Distributed Component Object Model (DCOM) and Common Object Request Broker Architecture (CORBA). These technologies fail because they rely on binary messaging. the lightweight XML messaging that SOAP employs works better over the Internet.

SOAP is commonly referred to web services, but it's more than web services.

SOAP exposes named operations. It enables applications to call functions from other applications, running on any hardware platform, regardless of different operating systems or programming languages.


SOAP nodes

A SOAP node can be any one of the followings:

  • SOAP sender: transmits a SOAP message
  • SOAP receiver: a SOAP node that accepts a SOAP message
  • SOAP message path: the set of SOAP nodes through which a single SOAP message passes
  • Initial SOAP sender (Originator): the sender that originates a SOAP message at the starting point of a SOAP message path
  • SOAP intermediary: is both a SOAP receiver and a SOAP sender. It processes the SOAP header blocks targeted at it and acts to forward a SOAP message towards an ultimate SOAP receiver. A typical intermediary does not modify the contents of the SOAP body, but adds or remove or modifies SOAP headers.
  • Ultimate SOAP receiver (the endpoint) The SOAP receiver that is a final destination of a SOAP message. It is responsible for processing the contents of the SOAP body and any SOAP header blocks targeted at it. In some circumstances, a SOAP message might not reach an ultimate SOAP receiver, for example because of a problem at a SOAP intermediary.

Why do we need intermediaries?

A typical use case of using intermediaries is a gateway on the edge of a company's network where all clients send their SOAP requests to. This gateway then processes incoming SOAP requests and forward according to what the SOAP headers say. The benefit is a more loose coupling between the services and clients, and that certain operations such as authentication, authorization, translation, etc. can be implemented in the gateway instead of repeating the work for each individual service.

The client only knows of the address of the gateway. The gateway is responsible for passing the request forward to the ultimate receiver (or any other intermediaries in between).


SOAP message

A SOAP message over HTTP is included in the message body. A typical SOAP message along with HTTP header looks like this:

POST /url HTTP/1.1
Host: HostServerName
Content-type: text/xml; charset=utf-8
Content-length: 350
SoapAction: http://example.com/GetCustomerInfo
...

<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetCustomerInfo xmlns="http://example.com/">
<CustomerID>1</CustomerID>
<OutputParam />
</GetCustomerInfo>
</soap:Body>
</soap:Envelope>



See Also