Figures 1 and 2 show the request and response structure of a remote procedure call transported as an HTTP request carrying a SOAP payload.
POST /Temperature HTTP/1.1
Host: www.temperature-service.com
Content-Type: text/xml
Content-Length: 357
SOAPAction: "http://weather.org/query#GetTemperature"
< SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
< SOAP-ENV:Body>
< m:GetTemperature xmlns:m="http://weather.org/query">
< longitude>39W< /longitude>
< latitude>62S< /latitude>
< /m:GetTemperature>
< /SOAP-ENV:Body>
< /SOAP-ENV:Envelope>
|
HTTP/1.1 200 OK
Content-Type: text/xml
Content-Length: 343
< SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
< SOAP-ENV:Body>
< m:GetTemperatureResponse xmlns:m="http://weather.org/query">
< centigrade>28.4< /centigrade>
< /m:GetTemperatureResponse>
< /SOAP-ENV:Body>
< /SOAP-ENV:Envelope>
|
SOAP allows hierarchically structured queries and responses, and specifies serialization of primitive string, numeric and date datatypes, and aggregates like arrays and vectors. Sparse arrays, and protocols for sending parts of them are also supported. New types may be defined using the <complexType> construct inside a schema definition.
Overall, SOAP provides many advantages. Unfortunately, its universality comes with a performance penalty: XML messages are textual and so the sizes of its messages are significantly larger than protocols which send binary data. Since a distinguishing characteristic of scientific computation is the need to handle large data sets, the performance of SOAP relative to specialized protocols that can use binary representations is an important issue. The next section tests SOAP performance relative to other communication protocols.