Java Reference
In-Depth Information
Generating a WSDL and Portable Artifacts Based on
a Java Service Endpoint Implementation
Problem
You want to generate a WSDL and portable web service artifacts (classes based on the WSDL)
starting from a service implementation class.
Solution
Use the wsgen command-line tool, included with JAX-WS.
Discussion
Create a Java class annotated with @WebService , and then execute the wsgen tool that comes
with Java. It will generate the following portable artifacts for you:
▪ A WSDL file, if you indicate so using the -wsdl option. The wsgen tool will only generate
a WSDL if you explicitly specify this option.
▪ JAXB classes required to marshal and unmarshal the messages exchanged in the service
definition.
There is only one argument required by wsgen : the name of the Java class that implements
your web service. You can also specify a variety of options. The form of using the tool is:
$ wsgen [options] service-implementation-class
Table 7-1 illustrates the set of options available for wsgen .
Search WWH ::




Custom Search