+

Search Tips   |   Advanced Search

wsimport command for JAX-WS applications


The wsimport command-line tool processes an existing WSDL file and generates the required artifacts for developing JAX-WS Web service applications.

The wsimport command-line tool supports the top-down approach to developing JAX-WS Web services. When you start with an existing WSDL file, use the wsimport command-line tool to generate the required JAX-WS artifacts.

Supported configurations: The wsimport, wsgen, schemagen and xjc command-line tools are not supported on the z/OS platform. This functionality is provided by the assembly tools provided with WAS running on the z/OS platform. Read about these command-line tools for JAX-WS applications to learn more about these tools.

Best practice: WebSphere provides JAX-WS and JAXB tooling.

The wsimport, wsgen, schemagen and xjc command-line tools are located in...

APP_ROOT\bin\

Similar tooling is provided by the Java SE Development Kit (JDK) 6. For the most part, artifacts generated by both the tooling provided with WebSphere and the JDK are the same. In general, artifacts generated by the JDK tools are portable across compliant runtime environments. However, it is a best practice to use the WebSphere tools to achieve seamless integration within the WebSphere environment. bprac

The wsimport tool reads an existing WSDL file and generates the following artifacts:

We can package the generated artifacts in a WAR file with the WSDL file and schema documents along with the endpoint implementation to be deployed.

Supported configurations: To correctly use the wsimport tool, adhere to the following requirements:

sptcfg

 

Syntax

The command line syntax is:

(Windows)

APP_ROOT\bin\wsimport.bat [options] WSDL_URI

[AIX] [HP-UX] [Linux] [Solaris]

APP_ROOT/bin/wsimport.sh [options] WSDL_URI

 

Parameters

The WSDL_URI is the only parameter that is required.

The following parameters are optional for the wsimport command:

-b <path>

External JAX-WS or JAXB binding files. We can specify multiple JAX-WS and JAXB binding files by using the -b option; however, each file must be specified with its own -b option.

-B <jaxbOption>

Specifies to pass this option to the JAXB schema compiler.

-catalog

Catalog file to resolve external entity references. It supports the TR9401, XCatalog, and the OASIS XML Catalog formats

-d <directory>

Specifies where to place the generated output files.

-extension

Whether to accept custom extensions for functionality that are not specified by the JAX-WS specification. The use of custom extensions can result in applications that are not portable or do not interoperate with other implementations.

-help

Display the help menu.

-httpproxy:<host>:<port>

Specifies an HTTP proxy. The default port value is 8080.

-keep

Whether to keep the generated source files.

-p <package_name>

Target package with this command-line option and overrides any WSDL file and schema binding customization for the package name and the default package name algorithm defined in the JAX-WS specification.

-quiet

Specifies to suppress the wsimport output.

-s <directory>

Directory to place the generated source files.

-target <version>>

Specifies to generate code that is compliant with a specific JAX-WS specification level. Specify version 2.0 to generate code that is compliant with the JAX-WS 2.0 specification. The default value is version 2.1 this indicates to generate code that is compliant with JAX-WS 2.1 specification.

-verbose

Specifies to output messages about what the compiler is doing.

-version

Prints the version information. If we specify this option, only the version information is included in the output and normal command processing does not occur.

-wsdlLocation

Specifies the @WebServiceClient.wsdlLocation value.

Supported configurations: The wsimport tool does not set the@WebsService.wsdlLocation value either by default or when the -wsdlLocation attribute is specified. The wsimport command-line tool updates the @WebServiceClient.wsdlLocation annotation only. We can manually update the @WebService.wsdlLocation annotation with a relative URL that specifies the location of the WSDL file. If the @WebService.wsdlLocation annotation is present on an endpoint implementation class, then the value must be a relative URL and the WSDL document that it references must be packaged with the application.





Related concepts


Assembly tools

 

Related tasks


Generating Java artifacts for JAX-WS applications from a WSDL file
Implementing Web services applications with JAX-WS

 

Related


wsgen command for JAX-WS applications
xjc command for JAXB applications
Web services specifications and APIs

 

Related information


Java API for XML Web Services (JAX-WS) API documentation