Java Reference
In-Depth Information
Style
The soap:binding element's style attribute can have the value of “rpc” or “document”. A
value of “rpc” indicates that you want to use SOAP messages containing parameters and re-
turn values. In this way, your web service will mimic an RMI call. A value of “document”
indicates you want your SOAP messages to use XML document instances. “Document” is the
default.
JAX-WS is the replacement technology for JAX-RPC. The name for the older technology is
telling. Much of Oracle's WebLogic web services implementations and documentation simply
assumes that you are using RPC style. This is in part due to the fact that RPC was simpler for
vendors to implement and more familiar and straightforward for developers to use. Accord-
ing to one manager on the Oracle web services team I spoke with, this is also due to the fact
that customers have a lot of JAX-RPC web services already out in the field and asked for lots
of support for it. However, in recent years, the implementations have become more sophist-
icated and developers more comfortable, and the industry has largely moved beyond RPC for
new work, choosing document instead. Document is more interoperable than RPC, and more
message-centric.
RPC style
In an RPC-based service, clients interact with the service as if it is a single, monolithic ap-
plication that exposes methods to that you pass parameters to. The messages map directly to
inputs and outputs.
An RPC-style SOAP request will wrap message parameters in an element named after the
current operation. By default, RPC responses are wrapped in an element named after the op-
eration with “Response” appended.
Document style
In a document-based service, clients interact with the service using XML document instances
based on schemas that represent a complete business entity, such as Author, Order, Invoice, or
Product. The XML document instances are self-describing, and offer you the best chance for
interoperability.
Document style essentially means that each message part will reference a concrete schema
type using its element attribute. The schema completely describes SOAP requests and re-
sponses, and requires no intrusion of external encoding rules.
Document-style services have been more difficult to create than RPC style. That's because
you typically need to create schemas, which requires a corresponding shift in thinking as you
consider your service as a service and not simply as a wrapper for an existing set of methods
that happens to use SOAP.
Search WWH ::




Custom Search