Java Reference
In-Depth Information
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="Catalog">
<port name="GenCatalogPort" binding="tns:GenCatalogPortBinding">
<soap:address location="REPLACE_WITH_ACTUAL_URL"/>
</port>
</service>
</definitions>
There are a few items of interest in this WSDL. First, it accepts the target namespace that you
specified between the curly braces with the -servicename option, and it preserves the name
for the <definitions> element. Next, it imports the abstract WSDL, a technique similar to
separating a Java interface from its implementation. Finally, the SOAP address location is not
specified and must be replaced with a URI value.
Note that you must run wsgen against a Java class that has already been compiled (not against
the source program), and if you specify a directory in which the tool should place generated
files such as the WSDL, that directory must exist before you run the program. Also, you must
run the tool against an implementation class, and not an interface.
Using the wsgen Ant task
If you want to run wsgen as part of an Ant build, an Ant task wrapper is available for the tool
in the usual location. It has the following structure:
<wsgen
sei="..."
destdir="directory for generated class files"
classpath="classpath" | cp="classpath"
resourcedestdir="directory for generated resource files such as WSDLs"
sourcedestdir="directory for generated source files"
keep="true|false"
verbose="true|false"
genwsdl="true|false"
protocol="soap1.1|Xsoap1.2"
servicename="..."
portname="...">
extension="true|false"
<classpath refid="..."/>
</wsgen>
Search WWH ::




Custom Search