Easier Web Service client development with JAX-WS
JAX-WS has simplified the development of Web Service clients when compared to JAX-RPC. Both technologies
have a tool for importing a WSDL to generate client
side artifacts. JAX-RPC's tool is
wscompile, JAX-WS' tool is
config.xml file must be created to
wscompile. A simple
config.xml file would look something like:
<?xml version="1.0" encoding="UTF-8"?>
config.xml would import the WSDL located at
and place the generated artifacts in the
You would then run
wscompile with the following command-line:
wscompile -gen:client config.xml
To do the same thing with JAX-WS'
the command-line would be:
wsimport -p helloservice http://localhost:8080/helloservice?wsdl
wsimport there is no need for the
The biggest advantage of JAX-WS clients over JAX-RPC clients is portability. JAX-WS generates 100% portable artifacts, while JAX-RPC generated artifacts are not all portable. Also, since JAX-WS is now included in Java SE 6 (Mustang), client applications are much smaller.
For a more complete instructions on how to use JAX-WS check out Bobby's articles on Building Web JAX-WS 2.0 Services with NetBeans and Building JAX-WS 2.0 Services with NetBeans and Glassfish.
You can get more information about JAX-WS on the JAX-WS project on java.net.
JAX-WS is part of the Glassfish Community.