SOAP Web Services

SOAP is a widely used standard for web services. SOAP uses XML to exchange information across a computer network. The SOAP standard doesn’t define any particular transport mechanism for the data exchange. But in practice, transport is almost always handled via HTTP POST requests. This means that Ajax XMLHttpRequest calls can be used to send SOAP requests.

The mechanics of SOAP data exchange can appear daunting, especially when compared to the relative ease of data exchange using REST-based web services.

A SOAP transaction starts when a SOAP client sends a request to a SOAP web service. This request is sent in a strictly-defined XML format called a SOAP envelope. This envelope contains a SOAP request, describing the name of a web service function and any parameters that function requires. On the SOAP server, this envelope is received and parsed. Its contents are validated and, if everything is in order, a SOAP response is constructed. This too is a strictly-defined XML format, which is then returned to the client. The SOAP response will contain error information if the request can’t be fulfilled.

Programmers often never see these low-level mechanics of SOAP requests. Most server languages provide SOAP libraries that hide most of these details. Even if you use one of these libraries, it’s useful to understand how these transactions occur, if only to demystify what may seem to be a complicated process.

The Google Web Search API

Google provides a SOAP interface ...

Get Ajax and 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.