Home > Ask the SOA Experts > Questions & Answers > RPC vs. document type of orientations
Ask The SOA Expert: Questions & Answers
EMAIL THIS

RPC vs. document type of orientations

Anne Thomas Manes EXPERT RESPONSE FROM: Anne Thomas Manes

Pose a Question
Other SOA Categories
Meet all SOA Experts
Become an Expert for this site
>
QUESTION POSED ON: 28 February 2002
What is the difference between RPC and document type of orientations in SOAP?

>

From a SOAP perspective, the distinction is whether or not you are using the SOAP RPC programming convention, as described in Section 7 of the SOAP 1.1 specification or Section 5 of the SOAP 1.2 Part 2 specification. This RPC programming convention is designed to allow SOAP to emulate an RPC call, i.e., to invoke a method using a method name and some set of parameters (0 or more), which returns a return value and some set of parameters (0 or more). From a wire perspective, a SOAP message body that's constructed using the RPC programming convention passes structures rather than individual elements. The request message (method invocation) is a modeled as a single struct, which contains an accessor for each [in] and/or [in/out] parameter. The name and type of the struct corresponds to the name and type of the method, and the name and type of each accessor corresponds to the name of each parameter. Likewise, the response message is modeled as a single struct containing an accessor for the return value (always the first accessor) and each of the [out] and/or [in/out] parameters. The name and type of each of the response accessors must match the name and type of the return parameters. When not using the RPC programming convention (usually referred to a SOAP Messaging), the message body may contain any number of elements. These elements normally conform to a schema of some sort, so a lot of folks characterize SOAP messaging by saying that you are passing "documents".

The terms "RPC-oriented" and "Document-oriented" are artifacts of the WSDL specification. To quote Section 3.4 of the WSDL 1.1 specification, "The style attribute [in the WSDL soap:operation element] indicates whether the operation is RPC-oriented (messages containing parameters and return values) or document-oriented (messages containing document(s)). This information may be used to select an aproriate programming model. The value of this attribute also affects the way in which the BODY of the SOAP message is constructed." [the message construction bit refers to the struct structure defined in the SOAP spec.] Keep in mind that if no value is specified, the default value is "document".

So -- this seems pretty straightforward. If you're invoking methods, you should be using the RPC programming convention, and you should describe your operations in WSDL as RPC-style. But it's not quite as simple as that. You can describe a SOAP message that uses the RPC programming convention as a document-style operation. And, in fact, Microsoft SOAP does so by default. This particular feature causes a fair amount of trouble when it comes to making .NET interoperate with other SOAP implementations. For easier interoperability, I'd recommend that you add the [SoapRpcService] directive to your applications to tell MS SOAP to define the service as RPC style, e.g.:

<%@ WebService Language="C#" Class="MSNetStockService" %>
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Services.Description;

[SoapRpcService]

public class MSNetStockService {
   [WebMethod] ..


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



SOA Governance White Papers - BPM, EDA, IT Governance
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2001 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts