![]() |
Table of Contents
SOAPSimple Object Access ProtocolThe Simple Object Access Protocol (SOAP) 1) 2) provides an XML 3) 4) based messaging system on top of the Hypertext Transfer Protocol (HTTP) 5) 6) or Simple Mail Transfer Protocol (SMTP) 7), and includes a system for exception handling (faults). SOAP requests and responses have the same basic structure: a SOAP Envelope enclosing an optional SOAP Header, a SOAP Body and optional SOAP Fault(s). If using HTTP as the transport there may also be additional HTTP headers set (e.g. SOAPAction). The Body contains the payload of the message encoded as an XML document. In most cases a software library is used which deals with the details of how to construct and decode SOAP messages, however it is useful to have some familiarity with the structure of SOAP messages when debugging. SOAP StylesThe SOAP messages exchanged between a service and client can be generated in a number of different forms depending on the SOAP style of the service.
The SOAP style has implications for the choice of SOAP tool-kit used when accessing the Web Service, since tool-kits often support a sub-set of styles. Compatibility and interoperability guidelines, such as The Web Services Interoperability Organization (WS-I) Basic Profile 8), often exclude the RPC/encoded style due to the diversity of possible encodings for a message. So many newer SOAP tool-kits have dropped support for RPC/encoded and there is a general move towards using the Document/literal or RPC/literal styles for new services. Older services are usually based on the RPC/encoded style, thus requiring careful selection of a SOAP tool-kit which supports this style. For more details about SOAP styles see Which style of WSDL should I use?. Document/literal Messages
The EB-eye service uses document/literal messages (in fact they are document/literal wrapped), for example using the
SOAP faults are encoded using document/literal, for example a propagated Java exception caused by invalid parameters being passed to the operation: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Fault: java.lang.NullPointerException</faultstring> </soap:Fault> </soap:Body> </soap:Envelope> These messages were captured using soapUI. RPC/encoded Messages
The WSDbfetch service uses RPC/encoded messages, for example using the
Since the format for a SOAP fault is defined as part of the specification, these are always encoded as document/literal, for example passing an incorrect database name to the <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <soapenv:Fault> <faultcode>soapenv:Server.userException</faultcode> <faultstring>uk.ac.ebi.jdbfetch.exceptions.DbfParamsException: Database, uniprota , not found!</faultstring> <detail> <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">tomcat-2.ebi.ac.uk</ns1:hostname> </detail> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope> These messages were captured using soapUI. SOAP Service DescriptionsA range of generic mechanisms exist for describing SOAP Web Service APIs:
Most SOAP Web Services have a WSDL based service description document, however WSDL 2.0 is seeing some adoption, for example in the specification of the SOAP binding for the SPARQL Protocol for RDF 13). The next section looks at WSDL 1.1 in more detail.
1)
SOAP 1.1 - http://www.w3.org/TR/soap11/
2)
SOAP 1.2 - http://www.w3.org/TR/soap12/
3)
Extensible Markup Language (XML) 1.0 - http://www.w3.org/TR/xml/
4)
Extensible Markup Language (XML) 1.1 - http://www.w3.org/TR/xml11/
5)
RFC1945 - Hypertext Transfer Protocol – HTTP/1.0 - http://www.faqs.org/rfcs/rfc1945.html
6)
RFC2616 - Hypertext Transfer Protocol – HTTP/1.1 - http://www.faqs.org/rfcs/rfc2616.html
7)
RFC5321 - Simple Mail Transfer Protocol - http://www.faqs.org/rfcs/rfc5321.html
8)
WS-I Basic Brofile 1.1 - http://www.ws-i.org/Profiles/BasicProfile-1.1.html
9)
Really Simple Web Service Descriptions (RSWS) - http://www.xml.com/lpt/a/1302
10)
SOAP Service Description Language (SSDL) - http://www.ssdl.org/
11)
Web Services Description Language Version 1.1 (WSDL) - http://www.w3.org/TR/wsdl
12)
Web Services Description Language Version 2.0 (WSDL 2) - http://www.w3.org/TR/wsdl20/
13)
SPARQL Protocol for RDF - http://www.w3.org/TR/rdf-sparql-protocol/
![]() |