The Artima Developer Community
This article is sponsored by the Java Community Process.

Leading-Edge Java
Recent JDK Features Ease Web Service Development
A Brief Review of JAX-RPC 2.0
by Frank Sommers
May 23, 2005

<<  Page 2 of 2

Advertisement

No longer just for SOAP

While earlier JAX-RPC specifications aimed to remain independent of a specific transport protocol, in reality they were closely aligned with SOAP. "In JAX-RPC 1.1, we tried to be SOAP-independent, but we ended up having [references] to SOAP types. With JAX- RPC 2.0, what's generated from WSDL is really independent of binding details," says Chinnici, the JAX-RPC 2.0 spec co-lead who also led the earlier JAX-RPC efforts.

The SOAP decoupling is part of the new JAX-RPC 2.0 handler framework that defines both logical and protocol-level handlers. A protocol handler can access the entire XML message transmitted in a JAX-RPC call, while logical handlers have no knowledge of the underlying protocol used to transmit a message, and can access a message's payload only.

"You can plug various handlers in [at deployment time], and create and configure a handler chain [to process JAX-RPC calls]," explains Chinnici. "There are configuration files, for instance, for SOAP message handlers. You would use those configuration files, instead of using the API, to create such handler chains." That approach provides flexibility in service deployment.

For service clients that require access at the XML message level, JAX-RPC 2.0 provides a new Dispatch API as well. At the center of that API, which replaces the old Call API, is the Dispatch interface that can be thought of as a conduit for a method call request. Dispatch enables, for instance, intercepting and examining a method dispatch request.

Asynchronous operations and tools support

The JDK 1.5 concurrency API (JSR 166) defines a Future interface to represent the results of an asynchronous operation [see Resources]. Asynchronous operations come in handy with Web services. "If you are calling on [the] Amazon [Web service], for instance, that Web service may not reply right away. Waiting for such replies is hard in a separate thread. What we're doing in JAX-RPC 2.0 is [that] when a tool maps the WSDL to Java, that tool can generate an asynchronous version of the code," says Chinnici. Asynchronous operations are supported via both polling and a callback mechanism. Examples for generating asynchronous service clients are included in the reference implementation's code samples.

One of the key aspects of JAX-RPC 2.0 is that it standardizes mechanisms that previously varied between each JAX-RPC implementation and tool. Developer tools, for instance, routinely offer customizations of WSDL generation from Java code, but such customizations were specific to each tool.

Defining standard ways to provide more Web service development flexibility will benefit tool vendors as much as developers. "By standardizing those mechanisms, we can get much better tool support much faster," says Sun's Chinnici. "Overall, our hope is that developers will find it a lot simpler to develop Web services with this new JAX-RPC version."

Summary

Web services have not taken off as quickly as once predicted. That lag may partly be due to the complexity of developing and deploying XML Web services. JAX-RPC 2.0 promises to vastly simplify Web service development for Java, chiefly by exploiting recently available Java features.

While the utilities in the JAX-RPC 2.0 reference implementation are very useful by themselves, many JAX-RPC 2.0 features will truly shine when incorporated in developer tools. JAX-RPC 2.0-aware developer tools will finally make developing and deploying a Java Web service almost as easy as writing a simple Java class.

Talk back!

Have an opinion about the directions in which JAX-RPC is headed? Discuss this article in the Articles Forum topic, Recent JDK Features Ease Web Service Development.

Resources

"Three Minutes to a Web Service," is a companion article that illustrates how annotations can simplify Web service creation:
http://www.artima.com/lejava/articles/threeminutes.html

JAX-RPC Project Home on java.net:
https://jax-rpc.dev.java.net/

You can download the JAX-RPC 2.0 early access release from java.net:
https://jax-rpc.dev.java.net/jaxrpc20-ea/

JSR 31: XML Data Binding Specification
http://www.jcp.org/en/jsr/detail?id=31

JSR 101: JavaTM APIs for XML based RPC
http://www.jcp.org/en/jsr/detail?id=101

JSR 109: Implementing Enterprise Web Services
http://www.jcp.org/en/jsr/detail?id=109

JSR 166: Concurrency Utilities
http://www.jcp.org/en/jsr/detail?id=166

JSR 175: A Metadata Facility for the Java Programming Language
http://www.jcp.org/en/jsr/detail?id=175

JSR 181: Web Services Metadata for the Java Platform
http://www.jcp.org/en/jsr/detail?id=181

JSR 222: Java Architecture for XML Binding (JAXB) 2.0
http://www.jcp.org/en/jsr/detail?id=222

JSR 224: JavaTM API for XML-Based RPC (JAX-RPC) 2.0
http://www.jcp.org/en/jsr/detail?id=224

Web Services Interoperability Organization Basic Profile Version 1.0
http://www.ws-i.org/Profiles/BasicProfile-1.0-2004-04-16.html

About the author

Frank Sommers is a Senior Editor with Artima Developer. He also serves as chief editor of the Web zine ClusterComputing.org, the IEEE Technical Committee on Scalable Computing's newsletter, and is an elected member of the Jini Community's Technical Advisory Committee. Prior to joining Artima, Frank wrote the Jiniology and Web services columns for JavaWorld.

<<  Page 2 of 2


This article is sponsored by the Java Community Process.

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us