RPC-Style Architectures
An RPC-style web service accepts an envelope full of data from its client, and sends a
similar envelope back. The method and the scoping information are kept inside the
envelope, or on stickers applied to the envelope. What kind of envelope is not important
to my classification, but HTTP is a popular envelope format, since any web service
worthy of the name must use HTTP anyway. SOAP is another popular envelope format
(transmitting a SOAP document over HTTP puts the SOAP envelope inside an HTTP
envelope). Every RPC-style service defines a brand new vocabulary. Computer pro-
grams work this way as well: every time you write a program, you define functions with
different names. By contrast, all RESTful web services share a standard vocabulary of
HTTP methods. Every object in a RESTful service responds to the same basic interface.
The XML-RPC protocol for web services is the most obvious example of the RPC ar-
chitecture. XML-RPC is mostly a legacy protocol these days, but I’m going to start off
with it because it’s relatively simple and easy to explain. Example 1-11 shows a Ruby
client for an XML-RPC service that lets you look up anything with a Universal Product
Statement:
All resources on this website are contributed and published by netizens, or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this website are for learning and reference only. Please do not use them for commercial purposes, otherwise you will be responsible for all consequences incurred! If there is any infringement, please contact us to delete and remove it. Contact information: admin@php.cn