The JavaTM Web Services Tutorial
Home
TOC
PREV TOP NEXT

What is JAX-RPC?

JAX-RPC stands for Java API for XML-based RPC. It's an API for building Web services and clients using remote procedure calls (RPC) and XML. Often used in a distributed client/server model, an RPC mechanism enables clients to execute procedures on other systems.

In JAX-RPC, a remote procedure call is represented by an XML-based protocol such as SOAP. The SOAP specification defines envelope structure, encoding rules, and a convention for representing remote procedure calls and responses. These calls and responses are transmitted as SOAP messages over HTTP. The JAX-RPC reference implementation relies on SOAP 1.1 and HTTP 1.1.

Although JAX-RPC relies on complex protocols, the API hides this complexity from the application developer. On the server side, the developer specifies the remote procedures by defining methods in an interface written in the Java programming language. The developer also codes one or more classes that implement those methods. Client programs are also easy to code. After locating the service endpoint by specifying a URL, the client simply invokes the methods on a local object (a stub) that represents the remote service.

With JAX-RPC, clients and Web services have a big advantage-- the platform independence of the Java programming language. In addition, JAX-RPC is not restrictive: a JAX-RPC client can access a Web service that is not running on the Java platform and vice versa. This flexibility is possible because JAX-RPC uses technologies defined by the World Wide Web Consortium (W3C): HTTP, SOAP, and the Web Service Description Language (WSDL). WSDL specifies an XML format for describing a service as a set of endpoints operating on messages. The JAX-RPC reference implementation includes a tool (xrpcc) that can read or write WSDL files. See the appendix, The xrpcc Tool (page 519).

Home
TOC
PREV TOP NEXT