Oracle GlassFish Server 3.0.1 Application Development Guide

The wsgen Task

Generates JAX-WS portable artifacts used in JAX-WS web services. Reads a web service endpoint class and generates all the required artifacts for web service deployment and invocation.

Attributes of wsgen

The following table describes attributes for the wsgen task.

Table 3–13 The wsgen Attributes

Attribute 

Default 

Description 

sei

none 

Specifies the name of the service endpoint interface (SEI) class. 

destdir

current directory 

(optional) Specifies where to place the output generated classes. 

classpath

system classpath 

(optional) Specifies where to find the input class files. Same as cp attribute.

cp

system classpath 

(optional) Specifies where to find the input class files. Same as classpath attribute.

resourcedestdir

current directory 

(optional) Specifies where to place generated resource files such as WSDL files. Used only if the genwsdl attribute is set to true.

sourcedestdir

current directory 

(optional) Specifies where to place generated source files. 

keep

false

(optional) If true, keeps generated files.

verbose

false

(optional) If true, outputs compiler messages.

genwsdl

true

(optional) If true, generates a WSDL file.

protocol

soap1.1

(optional) Specifies the protocol to use in the wsdl:binding. Used only if the genwsdl attribute is set to true.

Allowed values are soap1.1 or Xsoap1.2. Xsoap1.2 is not standard and is only used if the extension attribute is set to true.

servicename

none 

(optional) Specifies a particular wsdl:service name for the generated WSDL file. Used only if the genwsdl attribute is set to true. For example:

servicename="{http://mynamespace/}MyService"

portname

none 

(optional) Specifies a particular wsdl:port name for the generated WSDL. Used only if the genwsdl attribute is set to true. For example:

portname="{http://mynamespace/}MyPort"

extension

false

(optional) If true, allows vendor extensions not in the specification. Use of extensions may result in applications that are not portable and may not interoperate with other implementations.

Example of wsgen

The following example generates portable artifacts for fromjava.server.AddNumbersImpl, uses compile.classpath as the classpath, and writes the WSDL file to ${wsdl.dir}.

<wsgen
   resourcedestdir="${wsdl.dir}"
   sei="fromjava.server.AddNumbersImpl">
   <classpath refid="compile.classpath"/>
</wsgen>