Java Reference
In-Depth Information
Table7-1.Options for the wsgen tool
Option
Purpose
Specifies where to find input class files.
-classpath
<path>
or
-cp
<path>
-d <directory>
Specifies where to place generated output files. This directory must exist before running
wsgen
.
Specifies whether to allow vendor extensions.
-extension
Shows the usage.
-help
Specifies whether to retain generated files.
-keep
-r <directory>
Specifies Destination directory for resource files such as WSDLs. Can only be used
when the
-wsdl
option is also used.
-s <directory>
Specify where to place generated Java source files.
Provides output messages about what the compiler is doing.
-verbose
Prints version information, e.g.,
JAX-WS RI 2.1.3-hudson-390-
.
-version
Indicates that you want
wsgen
to generate a WSDL file. The protocol is optional. Valid
protocols are soap1.1 (the default) and
Xsoap1.2
(which is not standard). Can only be
used when the
-extension
option is also used.
-
wsdl[:protocol]
Specifies the Service name to use in the generated WSDL. Can only be used when the
-
wsdl
option is also used.
-servicename
<name>
Specifies the Port name to use in the generated WSDL. Can only be used when the
-
wsdl
option is also used.
-portname
<name>
NOTE
Using extensions (functionality not specifically outlined by the specifications) may result in applica-
tions that are not portable or may not interoperate with other implementations.
Here is an example. In the following class, you have a web service definition, for which you'll
create a WSDL:
package com.soacookbook;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;