JAX-WS 2.0 Early Access - wsgen


Last Modified: 06/07/05

wsgen

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.

Syntax

wsgen [options] <SEI class>

The following table lists the wsgen options.

Table 1-1 wsgen Options

Option

Description

-classpath <path>

Specify where to find input class files

-cp <path>

Same as -classpath <path>

-d <directory>

Specify where to place generated output files

-help

Display help

-keep

Keep generated files

-nd <directory>

Specify where to place non-class generated files

-s <directory>

Specify where to place generated source files

-verbose

Output messages about what the compiler is doing

-version

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.


Ant task

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

fork

Forks the wsgen process into another virtual machine

n/a

jvmargs

Arguments to pass to the forked virtual machine

n/a

endpointImplementationClass

Service endpoint implementation class

SEI class

base

Specify where to place output generated classes

-d

classpath

Specify where to find input class files

-classpath

cp

Same as -classpath

-cp

nonClassDir

Specify where to place non-class generated files

-nd

sourceBase

Specify where to place generated source files

-s

keep

Keep generated files

-keep

verbose

Output messages about what the compiler is doing

-verbose

version print out the JAX-WS version
-version

genWsdl

Specify that a WSDL file should be generated

-wsdl

protocol

Used in conjunction with genWsdl to specify the protocol to use in the wsdl:binding.  Value values are "soap11" or "soap12"

-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.

Example

  <wsgen
fork="true"
nonClassDir="${wsdl.dir}"
endpointImplementationClass="fromjava.server.AddNumbersImpl"/>


Copyright © 2005 Sun Microsystems, Inc. All rights reserved.