Mitch has done a good job of clarifying it in his article.
A Distinction has been made between Communication Pattern and Style.
Excerpt:
we turn to the two decisions for formatting the contents of a message's
element.
The style, or binding style, decision controls how the elements just under the SOAP body are constructed. The two choices are:
- RPC: Add extra elements to simulate a method call. (Note that RPC is also a communication pattern.)
- Document: Just send the XML as is. There's also a variation called wrapped that is still specified as document.
Here's an example of an RPC-style message:
RPC relies on some rules. Observe that the root element is qualified with a namespace, but the two child elements use unqualified names. The root element is named after the operation: opName
for a SOAP request, opNameResponse
for a SOAP response. Each child is a parameter, or a return value named opNameReturn
.
Now here's an example of a document-style message:
Observe that all elements are defined within the same namespace. With a document-style Web service, you're free to define the XML however you wish because all the XML is explicitly specified.
Next, we examine how binding style is specified in the WSDL. There actually is a style
attribute in the
Table 1. How binding style is specified in a WSDL document
| RPC | Document |
| style="rpc" | style="document" |
| Any number of
| Single
|
A WSDL document provides the interface (a generic "list of methods") and a set of instructions that describe how the service is bound to a messaging protocol.
The WSDL 1.1 specification distinguishes two different binding styles, as follows:
* RPC Style: This style specifies that the
* Document Style: In this style, there is no wrapper element. Instead, the message parts appear directly under the
Within those styles, you can also have an encoded use or a literal use:
* Encoded: In this use, each message part references an abstract type using the type attribute. The message is produced using an encoding specified by the encodingStyle attribute. The encoding most frequently used is SOAP Encoding, which is a set of serialization rules defined in SOAP 1.1. The rules specify how objects, structures, arrays, and object graphs should be serialized. In general, applications that use SOAP encoding focus on remote procedure calls, and likely use the RPC message style.
* Literal: In this use, each part references a concrete schema definition using either the element or type attribute. In other words, data is serialized according to a given schema. In practice, this schema is usually expressed using W3C XML Schema.
To summarize, the binding style/use combinations are:
* RPC/encoded
* RPC/literal
* Document/encoded
* Document/literal
Refer to this JDC Tip
No comments:
Post a Comment