Sun Java Solaris Communities My SDN Account Join SDN
 
Article

JAX-RPC Brings Portability to Web Services

 

by Janice J. Heiss

Web services, which provide great promise of services on demand from anywhere and to anywhere across the Web, are here to stay. The promise of across-the-Web interoperability has recently been combined with the portability provided by Java technology.

The Java platform has established a core API for developing and using Web services, the Java API for XML-based RPC (Remote Procedure Calls), known as JAX-RPC, which enables developers to create interoperable and portable SOAP-based Web services. A required part of the Java 2, Enterprise Edition (J2EE) 1.4 platform, the JAX-RPC Web services API can also be developed and deployed on J2EE 1.3 and servlet containers. JAX-RPC enables Web services interoperability across heterogeneous platforms and languages, thus making it a key technology for Web services-based integration.

diagramRPC Web Service Architecture

Remote Procedure Calls

An RPC is a mechanism that allows a client to execute procedures on other systems. The RPC mechanism is often used in a distributed client/server model in which the server defines a service as a collection of procedures that may be called by remote clients. RPCs are represented by XML-based protocols such as SOAP or the Java language. In the context of Web services, RPCs are represented by SOAP when transmitted across systems.

In addition to defining envelope structure and encoding rules, the SOAP specification defines a convention for representing remote procedure calls and responses. An XML-based RPC server application can define, describe and export a Web service as an RPC-based service. WSDL (Web Service Description Language) specifies an XML format for describing a service as a set of endpoints operating on messages. With the JAX-RPC API, developers can implement clients and services described by WSDL.

"We are seeing more and more success in Web services. A lot of the hype about moving interoperability to the Web is justified."

- Rahul Sharma,
lead architect and specification lead of JAX-RPC 1.0 JSR

An Open Java Technology Standard

JAX-RPC has been developed as a standard specification under the Java Community Process (JCP) as Java Specification Request-101. It results from the collaboration of multiple vendors under the JCP expert group.

The JAX-RPC standard enables portability of Web services across multiply compatible implementations, providing significant benefits for developers.

"We are seeing more and more success in Web services," observes Rahul Sharma, lead architect and specification lead of JAX-RPC 1.0 JSR. "A lot of the hype about moving interoperability to the Web is justified. As the developer community continues to test interoperability across various SOAP implementations, the future of Web services grows more promising."

JAX-RPC -- Uniquely Portable

What is most distinctive about JAX-RPC is its portability, an advantage not available to other platforms. "If I develop and deploy a Web service on a particular vendor A's product, I should also be able to do the same on vendor B's product, using JAX-RPC, without changing my Web services," observes Sharma. "This is possible because JAX-RPC APIs are standard APIs, so we make no assumptions that are specific to a particular product or implementation. To test that an implementation of JAX-RPC conforms to the standard, we're distributing the Technology Compatibility Kit (TCK) as part of the JAX-RPC initiative."

For Web services to be viable, the implementations of different vendors must interoperate, no less so for JAX-RPC implementations. They must also interoperate with implementations of SOAP and WSDL on other platforms as well.

"We expect that vendors will quickly adopt the Web services standards being defined through the JCP," predicts Sharma.

JAX-RPC benefits include:

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

"JAX-RPC is about heterogeneous Web services," notes Sharma. "It does not assume that both client and service endpoint be both developed using the Java platform. Your client could be a .NET client invoking J2EE services, or vice-versa, so you could have Java applications or Enterprise JavaBeans (EJB) components invoking services that are developed on .NET."

"If I develop and deploy a Web service on a particular vendor A's product, I should also be able to do the same on vendor B's product, using JAX-RPC, without changing my Web services."

- Rahul Sharma,
lead architect and specification lead of JAX-RPC 1.0 JSR

Developers use the standard JAX-RPC programming model to develop SOAP-based Web service clients and endpoints. A Web service endpoint is described using a Web Services Description Language (WSDL) document. In a similar manner, 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 provides an easy to develop programming model for development of SOAP-based Web services. Developers use the RPC programming model to develop Web service clients and endpoints. For typical scenarios, developers are not exposed to the complexity of the underlying runtime mechanisms (for example, SOAP protocol level mechanisms, marshaling and unmarshaling). A JAX-RPC runtime system (a library) abstracts these runtime mechanisms for the Web services programming model, which simplifies Web service development.

JAX-RPC provides support for WSDL-to-Java-platform and Java-platform-to-WSDL mapping as part of the development of Web service clients and endpoints. In a typical development environment, tools provide this mapping functionality, which further simplifies application development. The reference implementation of JAX-RPC provided with the Java Web Services Developer Pack includes such a mapping tool.

Servlets and EJB Components

JAX-RPC enables a Web service endpoint to be developed using either a servlet or an EJB component model. A Web service endpoint is deployed on either the Web container or EJB container based on the corresponding component model. These endpoints are described using a WSDL document. This WSDL document can be published in a registry, though this is not required. Another Java API, JAXR, is available to register a Web service endpoint and its WSDL.

A client uses the WSDL document and invokes the Web service endpoint. A JAX-RPC client can use stubs-based, dynamic proxy or dynamic invocation interface (DII) programming models to invoke a heterogeneous Web service endpoint.

"We expect that vendors will quickly adopt the Web services standards being defined through the JCP."

- Rahul Sharma,
lead architect and specification lead of JAX-RPC 1.0 JSR

Tools

Tools are a key part of JAX-RPC. "In an example development scenario, I start with a WSDL document that describes the Web service using XML," says Sharma. "Then I need a tool to convert the WSDL into a Java service endpoint interface that I would implement as part of the implementation of the endpoint. So I need a WSDL-to-Java language mapping tool. An endpoint can be implemented using either an EJB or servlet component based model. Developers next need a deployment tool that deploys a service endpoint. You have to configure the endpoint address for this particular Web service, and you have to configure the protocol binding. There are tools involved at each level. The JAX-RPC defines the common facilities and mechanisms that these tools build on. Tools will be critical in simplifying Web service development."

JAX-RPC Compatible Implementations

Who will implement JAX-RPC tools? Since JAX-RPC is a standard developed as part of the Java Community Process, the JSR includes a reference implementation that is the specification lead for the specific JSR. "We expect a lot of vendors to build implementations of JAX-RPC," says Sharma.

Why would vendors who have already written their own Web services tools support JAX-RPC APIs? "It goes back to portability and standards," points out Sharma. "Vendors' implementations need to port and interoperate. Vendors need to be able to develop a Web service on one product and deploy it on another. JAX-RPC is a step in that direction. And they need to interoperate with implementations of SOAP, WSDI and other platforms."

Java 2 Platform, Micro Edition (J2ME) For Web Services

As part of the overall Java platform, the creators of JAX-RPC are focused on the end-to-end development and deployment model. "We see Java 2, Micro Edition (J2ME) MIDP clients, J2SE applications, as well as J2EE components being clients," observes Sharma. "Sun has filed a Java Specification Request for building J2ME support for Web services. This defines a set of JAX-RPI APIs for MIDP clients. There are clear footprint restrictions, given that typical midlets deployed on the MIDP platform are less than 30K in size. And there are bandwidth constraints."

end.

See Also

Java API for XML-Based RPC (JAX-RPC) Downloads & Specifications
(http://java.sun.com/xml/downloads/jaxrpc.html)

Java Web Services Developer Pack Part 2: RPC Calls, Messaging, and the JAX-RPC and JAXM API
(http://developer.java.sun.com/developer/technicalArticles/WebServices/WSPack2/)

Java API for XML-Based RPC (JAX-RPC)
(http://java.sun.com/xml/jaxrpc/)

Java API for XML-Based RPC Documentation
(http://java.sun.com/xml/jaxrpc/docs.html)

Java API for XML-Based RPC (JAX-RPC) Frequently Asked Questions
(http://java.sun.com/xml/jaxrpc/faq.html)

Java Technology and Web Services
(http://java.sun.com/webservices/)

Designing Web Services with the J2EE 1.4 Platform
(http://java.sun.com//blueprints/guidelines/designing_webservices/)

Java Technology and XML
(http://java.sun.com/xml/)

Oracle is reviewing the Sun product roadmap and will provide guidance to customers in accordance with Oracle's standard product communication policies. Any resulting features and timing of release of such features as determined by Oracle's review of roadmaps, are at the sole discretion of Oracle. All product roadmap information, whether communicated by Sun Microsystems or by Oracle, does not represent a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. It is intended for information purposes only, and may not be incorporated into any contract.