Chapter 4. RPC-Style Services
Although SOAP is not limited to a particular style of distributed computing, it lends itself to a remote procedure call (RPC) model. This is only what you would expect; according to the SOAP specification, one of SOAP’s design goals is to encapsulate and exchange RPC calls. This approach maps very nicely to Java programming because method calls on Java objects can be easily translated to RPC calls. We’ll start this chapter by looking at the structure of SOAP RPC request and response messages. From there we’ll implement some RPC services in Java and deploy those services in both Apache SOAP and in GLUE. And, of course, we’ll write some Java code to make use of those services.
SOAP RPC Elements
Creating a SOAP RPC request uses the SOAP structure and encoding described in Chapter 2 and Chapter 3. No new XML or data encoding styles are needed for RPC. Let’s take a look at what’s required to represent an RPC method call in SOAP:
The target object
Method name
Method parameters
SOAP header data
Target Object URI
The target object URI is, essentially, the resource address of the service that we want to use. You see resource addresses all the time when you browse the Web — you navigate to a web page by specifying the page’s resource address. For instance, to look at the page describing the author of O’Reilly’s JavaBeans book, you’d use the URL http://www.oreilly.com/catalog/javabeans/author.html. The protocol, server address, and resource are all together. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access