JAX-RPC Service Model

As Screenshot shows, the service model for JAX-RPC is similar to other RPC models, such as RMI-IIOP and CORBA. The model has several components.

Java Click To expand
Screenshot: The JAX-RPC model

The layers shown in Screenshot correspond to the Open System Interconnection (OSI) networking model, which has these characteristics:

Although JAX-RPC relies on complex protocols, the API hides this complexity from the app developer. On the server side, the developer specifies the remotely accessible procedures by defining methods in a Java service definition interface and writing one or more Java classes that implement those methods. JAX-RPC exposes these objects as a service endpoint and generates the relevant ties. The client never directly communicates with the service implementation. The client uses a stub or other mechanisms to communicate with the endpoint (covered later in this chapter), and the endpoint uses the tie. The client then invokes the service, passing in relevant parameters, and the service returns the results to the client.

Before we dive into the internals of this model, we will take a look at the data types and see how the marshalling and unmarshalling occurs. We will then see how to use that in developing JAX-RPC services.