The WSDL2Java command tool creates Java classes and deployment descriptor templates from a WSDL file. See Map between Java, WSDL, and XML for more information.
Note: In WebSphere Application Server - Express Version 5.1.1 and later, the WSDL2Java command recognizes and processes non-SOAP ports and bindings that are found in the WSDL file.
Classes and files generated
The WSDL2Java script generates these kinds of classes and files:
For each portType in the WSDL document (<wsdl:portType> element tag):
For each service in the WSDL document (<wsdl:service> element tag):
When the role is a server role, the container argument specifies which J2EE container the implementation uses. When the -role develop-server -container web arguments are specified, the files are generated into the WEB-INF directory.
For each binding in the WSDL file (<wsdl:binding> element tag):
Other classes and files:
Authority
To run this script, your user profile must have *RX authority.
Syntax
The syntax of the script is:
WSDL2Java WSDL-URI [arguments]
Parameters
The parameters of the script are:
WSDL-URI Specifies the location of the input WSDL document using a Universal Resource Identifier (URI). You can also use a regular file path if the WSDL file is on the local file system.
-container
This is an optional parameter. The value j2ee-container specifies the J2EE container to be used. Valid values are client, web, and none. If client is role, the default argument is none. If server is role, the container must be web. The same container option must be used for both development and deployment.
-deployScope
This is an optional parameter. The value scope specifies how to deploy the server implementation. These are the valid values:
-genResolver
Generates an absolute-import resolver class. The purpose of this class is to record the contents of the imported WSDL files used by the WSDL URI. This class is used by the runtime. It can also be used for future WSDL2Java command runs. This is desirable when the imported WSDL files are remote and can be inaccessible or slow to access. It also eliminates the possibility that a remote WSDL file might have different contents at run time than it did at development time. The generated class is named _AbsoluteImportResolver.java. You should compile and package this class with the other Java classes generated by the WSDL2Java command.
-help
Displays a help message.
-helpX
Displays a help message for extended options.
-inputMappingFile
This is an optional parameter. The value mapfile specifies the file name of the Java to WSDL mapping file. If the input WSDL file is generated from Java code by the Java2WSDL command or another vendor tool by following the JAX-RPC standard, a mapping file is also generated. By supplying the inputMappingFile, you ensure the Java classes generated by the WSDL2Java command are compatible with the Java classes originally used to generate the WSDL file.
-NStoPkg
This is an optional parameter. If you specify this parameter, the script maps the namespace specified by namespace to the package specified by package. Specify this parameter once for each unique namespace mapping. For example, if there is a namespace in the WSDL file called urn:AddressFetcher2, and you want files generated from the objects in this namespace to reside in the package samples.addr, provide the -NStoPkg urn:AddressFetcher2=samples.addr argument to the WSDL2Java command. By default, package names are automatically derived from the namespace strings in the WSDL file. For example, if the namespace is of the form http://x.y.com or urn:x.y.com, the corresponding package is com.y.x.
Note: The default XML namespace to Java package mapping does not take the context root into account. If two namespaces are the same up to the first slash, they are mapped to the same Java package. For example, the XML namespaces http://www.ibm.com/foo and http://www.ibm.com/bar both map to the Java package com.ibm.www. Use the -NStoPkg option to specify the package for the fully qualified namespace.
-output
This is an optional parameter. The value directory sets the root directory for the files that the script generates.
-role
This is an optional parameter. The value j2eeRole specifies the J2EE development role that identifies which files to generate. Valid values are:
-timeout
This is an optional parameter. The value seconds specifies how long the WSDL2Java command should wait, in seconds, for the WSDL-URI to respond before giving up. The default is 45 seconds, -1 disables the timeout.
-useResolver
This is an optional parameter. The value resolver-class specifies an absolute-import resolver class to use during parsing. This class must have been created during a previous execution of the WSDL2Java command using the -genResolver option. The class must be available in CLASSPATH.
-verbose
Displays processing information, including the names of the generated files.