Reading a WSDL
A WebService emerges from a number of layers
- The bottom layer is ruled by the SOAP specification. It contains the rules for constructing the envelopes.
- Above this is the interface layer ruled by the WSDL specification (which makes use of the XMLSchemas specification).
Spray vs Splash
Spray is a WebServices implementation and understands SOAP, WSDL and XMLSchema.
Splash is a SOAP only implementation, and the user must determine the interface of a service from its WSDL or documentation.
Reading a WSDL
- Most WebServices active today have RPC/Encoded operations.
- Most WebServices created by .NET have DOC/Literal operations.
- At the soap layer, most .NET DOC/Literal operations look like RPC/Encoded operations. The difference is how they are described: "RPC/Encoded operations" and "DOC/Literal operations" are WSDL (metadata) concepts, not SOAP concepts.
The WSDL above contains two operations. The "Multiply" operation is RPC/Encoded, and the "Add" operation is Doc/Literal.
- The other combinations of style/encoding can exist, but these are not commonly used.
- Most services use only one combination for all operations in a service. (This particular WSDL is from a WSDL interop test).
- While technically it is the operations of a service which are either "Doc/Literal" "RPC/Encoded", since most services use only one combination, the service as a whole can be described as either "Doc/Literal" "RPC/Encoded".
Style Difference
style="rpc"
style="document"
In document style any number of documents can be placed under the SOAP-ENV:Body node. RPC style is a special case of document style. There is only one child of SOAP-ENV:Body, and that child is the RPC Wrapper element.
The RPC Wrapper element is defined by the SOAP specification in the RPC section (Section 7 in the SOAP1.1 specification). It contains contains a method signature; method name and namespace as well as a number of parameters.
Many .NET services use the document style to describe soap envelopes that look like they contain a RPC Wrapper element
Encoding Difference
A WSDL which defines an operation with use="encoded" and encodingStyle="http://schemas.xmlsoap.org/soap/encoding/", is stating that the xml has been encoded using Soap encoding, which is a set of rules (Section 5 in the SOAP1.1 specification) for serializing an object graph to XML.
When use="literal" the xml can be validated using a schema. XMLSchema is a specification for describing xml documents, which is a much broader in scope than simply describing xml documents that represent data structures.
Steve Waring
