JAX-RPC 2.0 Early Draft 2
The JSR 224 Expert Group just published a second early draft of JAX-RPC 2.0. There's lots of new stuff in this draft so I'll just pull out some of the highlights here:
- Chapter 7 defines a set of annotations that can be used with JAX-RPC. These annotations are used directly by developers when publishing a Java class as a Web service and are also used when mapping WSDL to Java to capture WSDL information required by the JAX-RPC runtime. Many of the annotations are defined by JSR 181. Use of annotations allows the following kind of thing:
The above defines a Java class to be a Web service and customizes the name and target namespace of the service's port type. The service has a single operation whose name is customized and whose action URI is defined. There are many other annotations that together provide a great deal of flexibility for building Web services. JAX-RPC also allows use of annotations defined by JAXB 2.0, these focus on customizing the mapping of Java data types to XML Schema types and elements.
public class HelloWorldService
public String helloWorld()
return "Hello World!";
- Just as annotations allow customization of the mapping from Java to WSDL, customizations provide similar functionality when mapping WSDL to Java. JAX-RPC provides a set of customizations and also allows JAXB customizations to be embedded. Together this set of customizations provides a very powerful standard WSDL/Schema to Java mapping facility.
- Dynamic Services
- We've added a new interface,
Provider, that a service endpoint can implement instead of a regular service endpoint interface. The
Providerinterface operates at the XML representation level and allows development of very dynamic services. It is the server side counterpart to the
Dispatchinterface that was introduced in the first early draft.
- WS-I Attachments Support
- We've introduced support for the WS-I Attachment Profile. Starting from Java one can generate WSDLs that use the flexible
wsi:swaRefmechanism. Starting from WSDL one can either use the
wsi:swaRefmechanism or the less expressive WSDL MIME binding. Support for the
wsi:swaRefmechanism is actually provided by JAXB, JAX-RPC simply provides the runtime capability to parse MIME messages and to serialize and deserialize data to/from MIME message parts.
- W3C MTOM Support
- We've also introduced support for W3C MTOM. As is the case for the
wsi:swaRefmechanism, JAXB provides the majority of the heavy lifing for MTOM support and JAX-RPC simply provides the runtime capability to parse MIME messages and to serialize and deserialize data to/from MIME message parts.
- W3C WSDL 2.0 Support
- We've included a preliminary mapping between Java and WSDL 2.0. This is currently in the form of two non-normative appendices since WSDL 2.0 is still a work in progress and we're unsure whether it will be complete in time for JAX-RPC 2.0.
We still have some additional work to do before we issue a public draft, in particular we are currently working on:
- Refactoring of the
Providerinterfaces to allow use with entire messages rather than just message payloads.
- API's to deploy lightweight service components on J2SE without use of a Servlet container.
- Additional annotations to capture necessary runtime information as our implementation experience grows.
Take a look and let us know what you think.