Sun Java Solaris Communities My SDN Account Join SDN
 
Article

Java API for XML-based RPC (JAX-RPC)

 
 

Articles Index

Core Web Services API in the Java Platform

The Java API for XML-based RPC (JAX-RPC) lets you develop SOAP-based, interoperable, and portable web services. JAX-RPC — a required part of the J2EE 1.4 platform — provides the core API for developing and deploying web services on the Java platform. JAX-RPC web services can also be developed and deployed on J2EE 1.3 and Servlet containers.

JAX-RPC provides many benefits to Java developers, including:

  • Portable and interoperable web services
  • Ease of development of web service endpoints and clients
  • Increased developer productivity
  • Support for open standards: XML, SOAP, WSDL
  • Standard API developed under Java Community Process (JCP)
  • Support for tools
  • RPC programming model with support for attachments
  • Support for SOAP message processing model and extensions
  • Secure web services
  • Extensible type mapping

Simpler Web Services Development

JAX-RPC is all about web services interoperability and integration across heterogeneous platforms and languages. You can use the JAX-RPC programming model to develop SOAP-based web service clients and endpoints. JAX-RPC enables clients to invoke web services developed across heterogeneous platforms. Likewise, JAX-RPC web service endpoints can be invoked by heterogeneous clients. JAX-RPC requires SOAP and WSDL standards for this cross-platform interoperability.

JAX-RPC simplifies web service development. For typical applications, developers are not exposed to the complexity of the underlying runtime mechanisms (for example, SOAP protocol-level mechanisms, marshaling, and unmarshaling). Instead, a JAX-RPC runtime system (a library) abstracts these runtime mechanisms for the web services programming model. What's more, JAX-RPC provides built-in support for WSDL-Java and Java-WSDL mapping as part of the development of web service clients and endpoints. In other development environments, you must use separate tools for this mapping functionality.

Web Service Endpoints

JAX-RPC lets you develop a web service endpoint using either a Servlet or Enterprise JavaBeans (EJB) component model. The endpoint is then deployed on either the Web or EJB container, based on the corresponding component model. Endpoints are described using a Web Services Description Language (WSDL) document.(This WSDL document can be published in a public or private registry, though this is not required). A client then uses this WSDL document and invokes the web service endpoint. A JAX-RPC client can use one of several programming models — stubs-based, dynamic proxy, or dynamic invocation interface (DII) — to invoke a heterogeneous web service endpoint.


SOAP and Other Messaging

Since JAX-RPC requires SOAP over HTTP for interoperability, support is provided through the SAAJ API for SOAP message handling; SAAJ provides a standard Java API for constructing and manipulating SOAP messages with attachments.With this support, you can build SOAP-specific extensions for security, logging and any other facility based on SOAP messaging.

JAX-RPC also provides support for document-based messaging. Using JAX-RPC, any MIME-encoded content can be carried as part of a SOAP message with attachments. This enables the exchange of XML documents, images, and other MIME types across web services. For security, JAX-RPC supports HTTP-level session management and SSL-based security mechanisms.

Open Java Standard

JAX-RPC has been developed as a standard specification under the Java Community process as the JSR-101 (see link at the end of this article). This means that the JAX-RPC specification is a result of the collaboration of multiple vendors working within the JCP expert group. And the JAX-RPC standard allows web services to be portable across these multiple compatibility implementations — a huge benefit for developers.

Products and Implementations

Sun provides a product quality reference implementation for JAX-RPC, bundled as part of the Java Web Services Developer Pack (Java WSDP) and Java XML Pack (see links at the end of this article). This reference implementation will also be available as part of the J2EE platform reference implementation.

In addition, Sun ONE Application Server 7.0 and Sun ONE Studio provide support for development and deployment of JAX-RPC web service endpoints and clients.

The JAX-RPC implementation has been tested for interoperability with many other products in the SOAP Builders community. Please see the Sun SOAP Builders link below for more details.

Delve Deeper: The JAX-RPC Chat

The jaxrpc-interest list is a great place to learn more about the JAX-RPC API. Here's how to subscribe:

Send email to listserv@java.sun.com with subscribe jaxrpc-interest yourlastname yourfirstname in the body of the message. To unsubscribe, send email with signoff jaxrpc-interest in the body of the message.

An archive of the list is available.

See Also

About the Author

Rahul Sharma is the architect and specification lead for JAX-RPC, and a Senior Staff Engineer at Sun Microsystems. Rahul has been part of the J2EE architecture team since its formation.