Protocol

Put all these factors together and we have a protocol. SOAP is an XML based protocol used to exchange information throughout a distributed environment.

Message-Based Document Exchange and RPC

SOAP has its roots in synchronous remote procedure calls over HTTP—although you wouldn’t know it by reading the specification these days. In fact, the specification seems to go out of its way to distance itself from that association. Although special provisions are available for performing synchronous RPC calls in SOAP, there is also an asynchronous, message-based document exchange model. Actually, the document exchange model is the default method of exchanging data between two endpoints. An RPC call is a specialized case of combining multiple one-way asynchronous messages into a request-response.

The introduction to Section 2 of the SOAP 1.2 specification says it well:

SOAP messages are fundamentally one-way transmissions from a SOAP sender to a SOAP receiver; however, SOAP messages are often combined to implement patterns such as request/response.

SOAP implementations can be optimized to exploit the unique characteristics of particular network systems. For example, the HTTP binding ... provides for SOAP response messages to be delivered as HTTP responses, using the same connection as the inbound request.[2]

Because SOAP can represent some fairly complex data structures in both the request and response messages, the lines between the two models are blurred. This chapter presents ...

Get Java Web Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.