Difference between RPC and Document-Centric/Message Oriented application

With Document/Literal encoding/ Message oriented application, the payload of a message is an XML fragment that can be validated against the corresponding XML schema, for instance:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:mi="http://www.somedomain.com/xyz/message-id"
    xmlns:proc="http://www.somedomain.com/xyz/processed-by"
    xmlns:po="http://www.books.com/purchase">
    <soap:Header/>
    <soap:Body>
        <po:purchaseOrder orderDate="2008-09-22"
            xmlns:po="http://www.somedomain.com/xyz/PO">
            <po:accountName>Books.com</po:accountName>
            <po:accountNumber>923</po:accountNumber>
            …
            <po:book>
                <po:title>Air Guitars In Action</po:title>
                <po:quantity>300</po:quantity>
                <po:wholesale-price>14.99</po:wholesale-price>
            </po:book>
        </po:purchaseOrder>
    </soap:Body>
</soap:Envelope>

RPC (remote procedure call)/Literal more closely corresponds to remote procedure invocations.
For instance, the method: public float getBookPrice(String inISBN) would correspond to the following RPC/Literal request message:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:sd="http://www.somedomain.com/xyz/BookQuote">
   <soap:Body>
      <sd:getBookPrice>
          <isbn>0321146182</isbn>
      </sd:getBookPrice>
   </soap:Body>
</soap:Envelope>

One important difference between RPC and Document web services is that with RPC web services, XML schema will only be created for complex type parameters. It is thus not possible to validate the entire XML fragment contained in the SOAP body.
With Document web services, however, the XML schema needs to define the ENTIRE XML fragment contained in the SOAP body. Consequently, the entire message can be validated against the XML schema.

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Random Thoughts

The World as I see it

Simple Programmer

Making The Complex Simple

Ionic Solutions

Random thoughts on software construction, design patterns and optimization.

Long (Way) Off

A tragic's view from the cricket hinterlands

%d bloggers like this: