Skip to main content

JAX-WS: wsimport tip

Posted by kohlert on November 9, 2005 at 12:59 PM PST

The wsimport tool of JAX-WS has added a -p
option. This option is used to specify the package that the generated artifacts should be generated into. This option eliminates the need to write a customization to do the same task.

For example, two customization files to specify that the package for a WSDL would be similar to the following:

custSchema - customizes the package that generated artifacts from schema use. 
    <package name="external_customize.client"/>

custWsdl - customizes the package that artifacts generated from the WSDL use.
    <bindings schemaLocation="http://localhost:8080/jaxws-external-customize/addnumbers?xsd=1" node="/xsd:schema">
            <package name="external_customize.client"/>

This would be passed to wsimport using the -b option:
For example:

wsimport -b custSchema -b custWsdl http://localhost:8080/jaxws-external-customize/addnumbers?wsdl"

With the new -p
option, the same thing can be accomplished with:
wsimport -p externa_customize.client http://localhost:8080/jaxws-external-customize/addnumbers?wsdl"

You can see a working sample code using both of these approaches in the external-customize and wsimport_catalog samples included in the nightly build of JAX-WS available here.

Related Topics >>