Scroll to navigation

wsgen(1) General Commands Manual wsgen(1)

Name

wsgen - Java(TM) API for XML Web Services (JAX-WS) 2.0

Specification Version: 2.1
Implementation Version: 2.1.1

The wsgen tool generates JAX-WS portable artifacts used in JAX-WS web services. The tool reads a web service endpoint implementation class (SEI) and generates all the required artifacts for web service deployment, and invocation

Overview

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. JAXWS 2.1.1 RI also provides a wsgen ant task, see Wsgen ant task @
https://jax-ws.dev.java.net/nonav/2.1.1/docs/wsgenant.html for details.

Launching wsgen

Solaris/Linux
*
export JAXWS_HOME=/pathto/jaxws-ri
*
$JAXWS_HOME/bin/wsgen.sh -help
Windows
*
set JAXWS_HOME=c:\pathto\jaxws-ri
*
%JAXWS_HOME%\bin\wsgen.bat -help

Syntax


wsgen [options] <SEI>

The following table lists the wsgen options.

0u
 0
Used only in conjunction with the \-wsdl option. Specify where to place generated resource files such as WSDLs
 0u
 0
 Specify where to place generated source files
 0u
 0
 Output messages about what the compiler is doing
 0u
 0
 Print version information. Use of this option will ONLY print version information. Normal processing will not occur.
 0u
 0
 By default \f2wsgen\fP does not generate a WSDL file. This flag is optional and will cause \f2wsgen\fP to generate a WSDL file and is usually only used so that the developer can look at the WSDL before the endpoint is deploy. The \f2protocol\fP is optional and is used to specify what protocol should be used in the \f2wsdl:binding\fP. Valid protocols include: \f2soap1.1\fP and \f2Xsoap1.2\fP. The default is \f2soap1.1\fP. \f2Xsoap1.2\fP is not standard and can only be used in conjunction with the \f2\-extension\fP option.
 0u
 0
 Used only in conjunction with the \f2\-wsdl\fP option. Used to specify a particular \f2wsdl:service\fP name to be generated in the WSDL. Example, \f2\-servicename "{http://mynamespace/}MyService"\fP
 0u
 0
 Used only in conjunction with the \f2\-wsdl\fP option. Used to specify a particular \f2wsdl:port\fP name to be generated in the WSDL. Example, \f2\-portname "{http://mynamespace/}MyPort"\fP
 0u
 ?Option???Description??
 ?-classpath <path>?????
 +528u
 -528u
 ?-cp <path>?????
 +528u
 -528u
 ?-d <directory>?????
 +528u
 -528u
 ?-extension?????
 +528u
 -528u
 ?-help???Display help??
 ?-keep???Keep generated files??
 ?-r <directory>?????
 +528u
 -528u
 ?-s <directory>?????
 +528u
 -528u
 ?-verbose?????
 +528u
 -528u
 ?-version?????
 +528u
 -528u
 ?-wsdl[:protocol]?????
 +528u
 -528u
 ?-servicename <name>?????
 +528u
 -528u
 ?-portname <name>?????
 +528u
 -528u
 0u

Example


wsgen -d stock -cp myclasspath stock.StockService 

This will generate the wrapper classes needed for StockService annotated with @WebService annotation inside stockdirectory.


wsgen -wsdl -d stock -cp myclasspath stock.StockService 

This will generate a SOAP 1.1 WSDL and schema for your Java class stock.StockService annotated with @WebService annotation.


wsgen -wsdl:Xsoap1.2 -d stock -cp myclasspath stock.StockService 

Will generate a SOAP 1.2 WSDL.

Note that you do not have to generate WSDL at the development time as JAXWS runtime will automatically generate a WSDL for you when you deploy your service.

16 Mar 2012