The Java2WSDL command tool maps a Java class to a Web Services Description Language (WSDL) file by following the Java API for XML-based remote procedure call (JAX-RPC) specification. The Java2WSDL command accepts a Java class as input and produces a WSDL file representing the input class. If there is an existing file at the output location, it is overwritten. The WSDL file generated by the Java2WSDL command contains WSDL and XML schema constructs that are automatically derived from the input class. You can override these default values with command-line arguments.
The WSDL file generated by the Java2WSDL command can contain unexpected elements. You can create WSDL files that cannot be compiled when regenerated into Java code using the WSDL2Java command because the JAX-RPC mapping from Java to WSDL is not reversible back to the original Java code. Inspect and modify the WSDL file if you encounter this problem.
Authority
To run this script, your user profile must have *RX authority.
Syntax
The syntax of the script is:
Java2WSDL class [argument...]
Parameters
The parameters of the script are:
class
This is a required parameter. The value class represents the fully qualified name of one of the following Java classes:
The Java2WSDL command locates the class in CLASSPATH.
-bindingName
This is an optional parameter. The value name specifies the name to use for the binding element. If not specified, the binding name is the portTypeName.
-help
Displays the help message.
-helpX
Displays the help message for extended options.
-debug
Displays debug messages.
-outputImpl
This is an optional parameter. The value impl-wsdl specifies if you want an interface and implementation WSDL file emitted.
-locationImport
This is an optional parameter. The value location-uri specifies the location of the interface WSDL file if you use the -outputImpl argument specified.
-MIMEStyle
This is an optional parameter. The value style specifies a style representing Multipurpose Internet Mail Extensions (MIME) information. Valid values are Axis and WSDL11. The default value is WSDL11.
-soapAction
This is an optional parameter. Valid arguments are:
-stopClasses
This is an optional parameter. If the -all argument is specified, the Java2WSDL command searches inherited classes and interfaces to construct the list of methods for WSDL file operations. The Java2WSDL command searches inherited classes and interfaces when generating extended complexTypes. The search stops when a class or interface is found within a package that begins with java or javax. The value parent specifies an additional class that cause the search to stop. To specify multiple classes, separate them with commas:
-stopClasses class1,class2
-namespaceImpl
This is an optional parameter. The value namespace specifies the target namespace for the implementation WSDL if -outputImpl specified.
-voidReturn
Valid arguments are:
-wrapped
This is an optional parameter. The value boolean specifies if the WSDL file should be generated according to wrapped rules. This is only valid if the value of the -use parameter is LITERAL. The option defaults to true.
-extraClasses
This is an optional parameter. The value classes specifies other classes that should be represented in the WSDL file.
-input
This is an optional parameter. The value wsdl-uri specifies the input WSDL file used to build an output WSDL file. Information from an existing WSDL file, whose name is specified in this option, is used with the input Java class to generate the desired output.
-implClass
This is an optional parameter. The Java2WSDL command uses method parameter names to construct the WSDL file message part names. The command automatically obtains the message names from the debug information in the class. If the class is compiled without debug information, or if the class is an interface, the method parameter names are not available. The value impl-class specifies an alternative class from which to obtain method parameter names. The specified class does not need to implement the class if the class is an interface, but it must implement the same methods as class.
-location
This is an optional parameter. The value location specifies the location or Uniform Resource Locator (URL) of the service. Typically, this value fills automatically when the Web service deploys. Use this argument to specify the location if you want to generate a WSDL file containing a location URL without deploying. A warning displays to remind you that the generated WSDL file should not be published if the final location is not yet been determined. The name after the last slash or backslash is the name of the service port, unless the name is overridden by the -servicePortName argument. The service port address location attribute is assigned the specified value.
-namespace
This is an optional parameter. The value targetNamespace specifies the target namespace for the WSDL file being generated.
-output
This is an optional parameter. The value wsdl-uri specifies the path and file name of the output WSDL file. If not specified, the default file, class.wsdl, is written into the current directory.
-PkgtoNS
This is an optional parameter. If you specify this parameter, the script maps the package specified by package to the namespace specified by namespace. If there is a package without a namespace, the Java2WSDL command generates a namespace name. Specify this parameter once for each mapping.
-portTypeName
This is an optional parameter. The value name specifies the name to use for the portType element. If not specified, the class name is used.
-serviceElementName
This is an optional parameter. The value name specifies the name of the service element.
-servicePortName
This is an optional parameter. The value name specifies the name of the service. If not specified, the service name is derived from the -location parameter.
-style
This is an optional parameter. The value style specifies the WSDL style to use in the generated WSDL file. Valid values are RPC and DOCUMENT. This parameter is used with the -use parameter.
For more information about styles, see Mapping between Java, WSDL and XML.
-transport
This is an optional parameter. The value transport_type specifies the type of tranpsort for which the script generates Simple Object Access Protocol (SOAP) bindings. The default value is http. You can specify the transport option only once.
-use
This is an optional parameter. The value use specifies the use that is generated into the WSDL file. Valid values are LITERAL and ENCODED. This parameter is used with the -style parameter.
For more information, see Mapping between Java, WSDL and XML.
-verbose
Displays verbose messages.