JAX-WS Customizations made easy with NetBeans 5.5
Often you need to override the default WSDL to Java bindings like changing XML Namespace to package mapping, generating asynchronous methods etc. Forget about vendor specific tool features or options you need to pass to customize WSDL to Java mapping. As you know, JAX-WS
Specification defines a standard binding language to customize WSDL 1.1 to Java binding. Whatever JAX-WS implementation you choose, it will generate the same Java bindings with the customization file. You can specify this customization by embedding the <jaxws:bindings> in the wsdl or specify in an external file and pass it to the WSDL to Java mapping tool. wsimport
tool of JAX-WS RI supports
customization in both ways.
JAX-WS defines lots of ways to customize WSDL to Java mapping from modifying the XML to Java name mapping, generating wrapper style signatures, generating asynchronous methods etc. Though the binding language is rich in its options, its confusing to write a customization file (sample) by hand as you need to exactly know what customization can be applied on a particular wsdl element. There comes NetBeans to the rescue.
NetBeans 5.5 with its built-in support for JAX-WS Web Services also provides a
nice GUI to customize WSDL to Java bindings easily. All you need to
do is right click on a Web Service(created from WSDL) or a Web
Service Reference and select "Edit Web Service Attributes"
as shown above. It opens up a window categorized according to WSDL
definitions. As shown below, if you want to generate asynchronous
methods, select the check box "Enable Asynchronous Client".
NetBeans does in the background is embed JAX-WS customizations in the
wsdl. NetBeans is also smart enough to provide different options for
Web Service and Web Service Client. For example, on a Web Service you
can specify "Use Provider Interface" on a port which is not
available on Web Service Client, "Enable Asynchronous Client"
can only be specified on Web Service Client. Not only does it embed
the customization, it regenerates the Java artifacts by invoking
wsimport with the customization as shown in below. You can even
specify external customization files for customizing schema mappings.
of JAX-WS customization is a good start. There are some improvements
that can be done. Currently it embeds the customization in the wsdl.
It is convenient if it were in an external file as you dont want
customization to show up in the wsdl which is used for deployment.
Although NetBeans regenerates the Java artifacts, it does n't
refactor the references in the application. Often schemas also need
to be customized. JAXB has tons of customizations to modify XML
Schema to Java mapping. NetBeans does n't yet support basic things in
jaxb global customization like mapping of namespace to pacakge name
or generating Interfaces instead of Classes etc. I hope these will be
addressed in future release of NetBeans.
There is a bug in NetBeans 5.5 Beta 2, where Web Services created from WSDL disappear after creation. It has been fixed in the recent builds. Download
latest daily build of NetBeans
5.5 and try it yourself.