JAX-RPC Working Mechanism

printer-friendly version of this section  Print  e-mail this section  E-Mail  add a public, group or private note  Add Note  add a bookmark about this section  Add Bookmark    

Java APIs for XML Kick Start
By Aoyon Chowdhury, Parag Choudhary

Table of Contents
Chapter 11.  Working with JAX-RPC


JAX-RPC uses SOAP and HTTP to do RPCs over the network. The SOAP specification defines the necessary structure, encoding rules, a convention for doing RPCs, and its corresponding responses. The RPCs and responses are transmitted over the network using HTTP as the primary transport mechanism.

From an application developer's point of view, an RPC-based system has two aspects: the server side (the Web service) and the client side. The Web service exposes the procedures that can be executed, and the client does the actual RPC over the network.

As discussed in earlier chapters, a Web service environment is based on open standards such as SOAP, HTTP, and WSDL. It is therefore possible that a Web service or a client wasn't developed using the Java platform. However, JAXR-RPC provides the mechanism that enables a non-Java client to connect to a Web service developed using Java platform, and vice versa. This chapter will focus on the development of a Web service and a client using JAX-RPC.

Figure 11.1 represents the communication exchange between a JAX-RPC-based client and a service.

Figure 11.1. Communication exchange between a JAX-RPC client program and a Web service.

graphics/11fig01.gif

Before we discuss the communication exchange process, you need to understand what stubs and ties are. Stubs are local objects that represent the remote procedures. Ties are classes that reside on the server and enable communication with the client.

It is assumed that the client is aware of the Web service and the remote procedure that it can execute on the Web service. This is what happens:

  1. The client calls the method on the stub that represents the remote procedure.

  2. The stub executes the necessary routines on the JAX-RPC runtime system.

  3. The runtime system converts this method call into a SOAP message and transmits the message to the server as an HTTP request.

  4. The server, upon receipt of the SOAP message, invokes the methods on the JAX-RPC runtime. The JAX-RPC runtime converts the SOAP request into a method call.

  5. The JAX-RPC runtime then calls the method on the tie object.

  6. Finally, the tie object calls the method on the implementation of the Web service.

  7. The response to the RPC call is sent in a SOAP response message as an HTTP response.

Now let's look at the physical implementation of a JAX-RPC-based server and client.


printer-friendly version of this section  Print  e-mail this section  E-Mail  add a public, group or private note  Add Note  add a bookmark about this section  Add Bookmark    
Top

[0672324342/ch11lev1sec1]

 
 


JavaT APIs for XML Kick Start
JAX: Java APIs for XML Kick Start
ISBN: 0672324342
EAN: 2147483647
Year: 2002
Pages: 133

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net