Differences Between RPC-oriented methods and Document-oriented methods

Previous Next

SOAP was originally designed to support only the RPC-oriented style (SOAP was intended to be an acronym for Simple Object Access Protocol) . With SOAP version 1.0, both RPC-oriented style and document-oriented style (unstructured messages) were supported.

With the document-oriented style, you can structure the contents of the SOAP body any way you like. With the RPC-oriented style, the contents of the SOAP body must conform to a structure that indicates the method name and contains a set of parameters.

An RPC-oriented SOAP request message has this structure:


   <m:MyMethodName xmlns:m="someURI">

       <m:FirstParameter>...</m: FirstParameter>

       <m:SecondParameter>...</m: SecondParameter >





The SOAP response message has a similar structure and contains the return value and any output parameters. Parameters can be as complex as you like.

Another difference is the encoding of the message. Literal encoding means that the Body contents conform to a specific XML schema. SOAP encoding uses a set of rules based on the XML schema data types to encode the data, but the message does not conform to a particular schema.

USoft uses literal encoding with document-oriented style and SOAP encoding with RPC-oriented style.

SOAP includes a built-in set of rules for encoding data types. This way, you can use specific data types in a SOAP message, such as integers, floats, doubles or arrays. SOAP data types are divided into two broad categories: simple (scalar) data types and complex (compound) data types.

Simple data types contain exactly one value, such as last name, price or product description. Complex types contain multiple values, such as a purchase order or a list of stock quotes.

For more information, refer to: Simple Type and Complex Type Parameters.

Note: When defining a web service method in USoft, use the RPC-oriented style when dealing with simple types.