You use the wsimport command to generate Java API for XML Web Services (JAX-WS) portable artifacts.


wsimport [ options ] wsdl_URI

This represents the wsimport command-line options. See Options for the wsimport Command.


The file that contains the machine-readable description of how the web service can be called, what parameters it expects, and what data structures it returns.


The wsimport command generates the following JAX-WS portable artifacts. These artifacts can be packaged in a WAR file with the Web Services Description Language (WSDL) file and schema documents and the endpoint implementation to be deployed. The wsimport command also provides a wsimport Ant task.

  • Service Endpoint Interface (SEI)

  • Service

  • Exception class is mapped from wsdl:fault (if any)

  • Async Response Bean is derived from response wsdl:message (if any)

  • Java Architecture for XML Binding (JAXB) generated value types (mapped Java classes from schema types)

To start the wsgen command, enter the following commands:

  • Oracle Solaris/Linux:

    /bin/ -help
  • Windows:

    \bin\wsimport.bat -help

Options for the wsimport Command

-b path

Specifies external JAX-WS or JAXB binding files. Multiple JAX-WS and Java Architecture for XML Binding (JAXB) binding files can be specified with the -b option. You can use these files to customize package names, bean names, and so on.

-B jaxbOption

Passes the jaxbOption option to the JAXB schema compiler.

-catalog file

Specifies a catalog file to resolve external entity references. The -catalog option supports the TR9401, XCatalog, and OASIS XML Catalog formats.

-classpath path or -cp path

Specifies where to find user class files and wsimport extensions.

-d directory

Specifies where to place generated output files.

-encoding encoding

Specifies the character encoding used by the source files.


Allows vendor extensions. Use of extensions can result in applications that aren’t portable or that don’t work with other implementations.


Displays a help message for the wsimport command.


Specifies an HTTP proxy server. The format is:



Passes this option to javac.


Keeps generated files.

-p name

Specifies a target package name to override the WSDL file and schema binding customizations, and the default algorithm defined in the specification.

—m name

Generates with the given Java module name.


Suppresses the wsimport command output.

-s directory

Specifies where to place generated source files.

-target version

Generates code according to the specified JAX-WS specification version. Version 2.0 generates compliant code for the JAX-WS 2.0 specification.


Displays compiler messages.


Prints version information.


Prints full version information.

-wsdllocation location

Specifies the @WebServiceClient.wsdlLocation value.

-clientjar jarfile

Creates the jar file of the generated artifacts along with the WSDL metadata required for invoking the web service.


Generates a stubbed Java Web Start (JWS) implementation file.

-implDestDir directory

Specifies where to generate the JWS implementation file.

-implServiceName name

Specifies the local portion of service name for generated JWS implementations.

-implPortName name

Specifies the local portion of the port name for generated JWS implementations.

Multiple JAX-WS and JAXB binding files can be specified using the -b option, and they can be used to customize various things such as package names and bean names.

Extensions for the wsimport Command


Maps headers not bound to a request or response message to Java method parameters.

-Xauthfile file

Specifies the WSDL URI that identifies the file that contains authorization information. This URI is in the following format:


Prints debugging information.


Enables binding of W3C EndpointReferenceType to Java.


Doesn’t compile the generated Java files.


Disables Authenticator used by the JAX-WS reference implementation. -Xauthfile option will be ignored if set.


Disables the SSL Hostname verification while fetching wsdl files.


The following are examples of using the wsimport command:

 wsimport stock.wsdl -b stock.xml -b stock.xjb
 wsimport -d generated