Home > SOA Tips > The Web Services Advisor > Java API for XML Web Services
SOA Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

THE WEB SERVICES ADVISOR

Java API for XML Web Services


William Brogden
06.20.2006
Rating: -4.50- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


The latest collection of Java based Web service developer tools is Sun's major revision of the Java Web Services Developer Pack (JWSDP), now version 2.0. The previous cycle of development of the JWSDP ended with version 1.6, released in mid 2005. The intent of this major revision is to better integrate technology use through the various toolkits. In version 2.0, the JAX-RPC (Java API for XML based Remote Procedure Calls) toolkit is gone, replaced by a new technology with the acronym, JAX-WS, the Java API for XML Web Services.

Officially, the JWSDP is aimed at supporting Web service development on Sun Java System Application Server Platform version 8.1 or higher. JWSDP installation and the Sun tutorial assume that is what you will be using. Many of the component toolkits in the JWSDP distribution, including he JAX-WS files, are NOT labeled as "redistributable" in Sun's release notes. However, most of the components, including JAX-WS, are also available in the GlassFish open source server project. Glassfish releases are covered by Sun's "Common Development and Distribution License" and may be distributed with your application.

Yes, having two JAX-WS releases makes for confusion! For example the JAX-WS version with the JWSDP is labeled "EA" for early access, but the release from project GlassFish is labeled "RI" for reference implementation. The final release of the JAX-WS specification as a product of the Java Community Process, JSR 224, just occurred in May, so we are dealing with the very latest material here.

The Goals of the JAX-WS 2.0 Specification

The full statement of the JSR 224 specification takes 149 pages of PDF document so I can only touch on each aspect briefly. These are the goals of JAX-WS 2.0:

Consolidate Data Binding

Previously there were "data binding" tools in both the JAXB (Java API for XML Binding) and JAX-RPC (Java API for XML Remote Procedure Calls) toolkits. This was obviously a source for confusion so JAX-WS will use JAXB 2.0. My previous article gave more details on JAXB.

Support Evolving Standards

Although many current Web services use the SOAP 1.1 standard for the protocol, format and syntax of Web service messages, the 1.2 standard has been out for a while and should see increasing support. JAX-WS will support the SOAP 1.2 standard while continuing to support the older 1.1 standard. Since SOAP 1.2 changes some aspects of SOAP message syntax, this is not a trivial problem. Incidentally, when the acronym SOAP first appeared it was supposedly for Simple Object Access Protocol. Since everybody agrees SOAP is not simple and has little to do with objects, we just call it SOAP without any other implications.

There is a similar evolving standard problem with WSDL (Web Service Description Language), used extensively in all areas of Web services. A WSDL document is an XML formatted description all the details needed to contact a Web service. The current version in use, which is not an actual W3C standard, is version 1.1. Although the W3C recently ratified the standard for version 2.0, JAX-WS does not presently attempt to support it.

Another standard is being evolved by the Web Services Interoperability Organization. The WS-I Basic Profile appears to have been developed because the SOAP standard is not sufficiently well defined to ensure that all Web service toolkits can talk to each other. JAX-WS will conform to developments in this area.

Make use of Java Language Advances

Java has always provided for one form of annotation in source code in the form of a set of comment keywords starting with the @ symbol that can be processed by the javadoc tool to generate HTML formatted pages of documentation. These documentation comments do not end up in the compiled Java classes.

The latest edition of the language, called Java 5 or Java 1.5 depending on where you are looking in the documentation, adds an important new feature. It is a kind of annotation that gets built into compiled classes and can be accessed at runtime. You can think of these annotations as metadata that describe how a class can be used -- for example, how it should be accessed as a Web service.

To give you an idea, here are a couple of the annotations in the JAX-WS sample Java source file AddNumbersIF.java for a Web service that returns the sum of two input numbers:

@WebService(targetNamespace = "http://duke.org", name="AddNumbers")
@WebMethod(operationName="add", action="urn:addNumbers")
Because these annotations end up in the compiled classes, the JAX-WS tools that work with compiled Java class files using the Java introspection facilities can get extra information about how the programmer intends the class to be used.

Transport Independence

Because we are talking about "Web services," people tend to forget that SOAP message transport is not restricted to HTTP (Hypertext Transfer Protocol.) There are plenty of applications in which transport by email or Java Message Service make better sense. The JAX-WS API document states that it is intended to "improve the separation between the XML message format and the underlying transport mechanism to simplify use of JAX-WS with non-HTTP transports." Development of examples using alternate transport mechanism seems to be lagging the HTTP Web service examples, but I did find one example using Java Message Service in the Glassfish project.

References

Main page for the JWSDP 2.0 release. http://java.sun.com/webservices/jwsdp/index.jsp main Sun page for JWSDP

Main page for the JAX-WS Reference Implementation as part of Project GlassFish. https://jax-ws.dev.java.net/

Web Services with JAXB from the JWSDP 2.0 release http://searchwebservices.techtarget.com/tip/1,289483,sid26_gci1192435,00.html

Java Community Process home for JAX-WS 2.0. http://jcp.org/en/jsr/detail?id=224

Java Community Process homes for Metadata (annotations) and web service Metadata specifications. http://www.jcp.org/en/jsr/detail?id=175, http://www.jcp.org/en/jsr/detail?id=181

Text of the Common Development and Distribution License (CDDL) Version 1.0.1 https://jwsdp.dev.java.net/CDDLv1.0.html

Introduction to SOAP 1.2 at the W3C http://www.w3.org/TR/soap12-part0/

Proposed Web Services Description Language (WSDL) version 1.1. http://www.w3.org/TR/wsdl

Web Services Interoperability Organization (WS-I Basic Profile) http://www.ws-i.org/

About the author

William Brogden is a developer who lives outside Austin, Texas. Although he has been working mainly with Java for the last ten years, he enjoys investigating new computer languages and XML applications.


Rate this Tip
To rate tips, you must be a member of SearchSOA.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
The Web Services Advisor
What to expect with the new JavaScript standardization (ECMAScript 5)
Restlet framework wrestles RESTful Web applications
3 tips for choosing whether to use EGL
Use SoaML to facilitate Model Driven Architecture
Enterprise mashup patterns act as API enablers
XQuery learns to write using XUF
Descriptive Languages for RESTful Services
Notable Python language update on view
Try XML-based Extensible Business Reporting Language (XBRL) for accounting reports
Whatever happened to ''X''?

Java
Java EE 5 and SOA: The vendors strike back
Analysts see Java EE dying in an SOA world
Web services with JAXB

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



SOA Trends and Strategy - SOA Education, SOA Development, SOA Implementations
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2001 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts