Oracle GlassFish Server 3.0.1 Application Development Guide

The wsimport Task

Generates JAX-WS portable artifacts for a given WSDL file. Portable artifacts include service endpoint interfaces (SEIs), services, exception classes mapped from the wsdl:fault and soap:headerfault tags, asynchronous response beans derived from the wsdl:message tag, and JAXB generated value types. After generation, these artifacts can be packaged in a WAR file with the WSDL and schema documents along with the endpoint implementation and then deployed.

Attributes of wsimport

The following table describes attributes for the wsimport task.

Table 3–14 The wsimport Attributes

Attribute 

Default 

Description 

wsdl

none 

Specifies the name of the WSDL file. 

destdir

current directory 

(optional) Specifies where to place the output generated classes. 

sourcedestdir

current directory 

(optional) Specifies where to place generated source files. Used only if the keep attribute is set to true.

keep

false

(optional) If true, keeps generated files.

verbose

false

(optional) If true, outputs compiler messages.

binding

none 

(optional) Specifies external JAX-WS or JAXB binding files. JAX-WS and JAXB binding files can customize things like package names and bean names. More information on JAX-WS and JAXB binding files can be found in the customization documentation included with this release. 

extension

false

(optional) If true, allows vendor extensions not in the specification. Use of extensions may result in applications that are not portable and may not interoperate with other implementations.

wsdllocation

none 

(optional) Specifies the value of @WebService.wsdlLocation and @WebServiceClient.wsdlLocation annotation elements for the generated SEI and Service interface. This should be set to the URI of the web service WSDL file.

catalog

none 

(optional) Specifies the catalog file to resolve external entity references. Supported formats are TR9401, XCatalog, and OASIS XML Catalog. Additionally, the Ant xmlcatalog type can be used to resolve entities.

package

none 

(optional) Specifies the target package, overriding any WSDL and schema binding customization for package name, and the default package name algorithm defined in the JAX-WS specification. 

Example of wsimport

The following example generates client-side artifacts for AddNumbers.wsdl and stores .class files in the ${build.classes.home} directory using the custom.xml customization file.

<wsimport
   destdir="${build.classes.home}"
   wsdl="AddNumbers.wsdl"
   binding="custom.xml">
</wsimport>