Last Modified: 06/07/05
The wsgen
tool generates JAX-WS portable artifacts
used in JAX-WS web
services. The tool reads a web service endpoint class and
generates all the required artifacts for web service deployment, and
invocation.
wsgen [options] <SEI class>
The following table lists the wsgen
options.
Table 1-1 wsgen Options
Option |
Description |
---|---|
|
Specify where to find input class files |
|
Same as |
|
Specify where to place generated output files |
|
Display help |
|
Keep generated files |
|
Specify where to place non-class generated files |
|
Specify where to place generated source files |
|
Output messages about what the compiler is doing |
|
Print version information |
-wsdl[:protocol] |
Generate a WSDL file. The
protocol is optional and is used to specify what protocol should be
used in the wsdl:binding . Valid protocols include: soap11
and
soap12 . The default is soap11 . |
An Ant task for the wsgen
tool is provided along
with the tool. The attributes
and elements supported by the Ant task are listed below:
<wsgen
fork= "true|false"
jvmargs="..."
endpointImplementationClass="..."
base="directory for generated class files"
classpath="classpath" | cp="classpath"
nonClassDir="directory for non-class generated files"
sourceBase="directory for generated source files"
keep="true|false"
verbose="true|false"
version="true|false"
genWsdl="true|false"
protocol="soap11|soap12">
<classpath refid="..."/>
</wsgen>
Attribute |
Description |
Command line |
|
Forks the |
n/a |
|
Arguments to pass to the forked virtual machine |
n/a |
|
Service endpoint implementation class |
SEI class |
|
Specify where to place output generated classes |
|
|
Specify where to find input class files |
|
|
Same as |
|
|
Specify where to place non-class generated files |
|
|
Specify where to place generated source files |
|
|
Keep generated files |
|
|
Output messages about what the compiler is doing |
|
version |
print out the JAX-WS
version |
-version |
|
Specify that a WSDL file should be generated |
|
|
Used in conjunction with |
-wsdl:soap11 |
The classpath
attribute is
a path-like
structure and can also be set via nested
<classpath>
elements. Before this
task can be used, a
<taskdef>
element needs to be
added to the project as given below:
<taskdef name="wsgen" classname="com.sun.tools.ws.ant.WsGen">
<classpath path="jaxws.classpath"/>
</taskdef>
where jaxws.classpath
is a reference to a path-like structure,
defined elsewhere in the build environment, and contains the list of
classes required by the JAX-WS tools.
<wsgen
fork="true"
nonClassDir="${wsdl.dir}"
endpointImplementationClass="fromjava.server.AddNumbersImpl"/>
Copyright © 2005 Sun Microsystems, Inc. All rights reserved.