|
Page Edited :
CXF20DOC :
Java to WSDL
Java to WSDL has been edited by Glen Mazza (Aug 25, 2007). Change summary: Added description for use with Ant. Synopsisjava2wsdl [-?|-help|-h][-o <output-file>][-cp <class-path>][-soap12][-t <target-namespace>][-servicenam <seservice-name>][-v][-verbose|-quiet][-s <source-directory>]
[-classdir <compile-classes-directory>][-portname <port-name>][-createxsdimports][-d <output-directory>] { classname }
You must include the classname argument. All other arguments are optional and may be listed in any order. This tool will search and load the service endpoint class and types classes. Make certain these classes are on the CLASSPATH or in a location identified through the -cp flag. Using java2wsdl with AntThe java2wsdl command can be wrapped inside an Ant target as shown below: <?xml version="1.0"?> <project name="cxf java2wsdl" basedir="."> <property name="cxf.home" location ="/usr/myapps/cxf-2.0.1"/> <property name="build.classes.dir" location ="${basedir}/build/classes"/> <path id="cxf.classpath"> <pathelement location="${build.classes.dir}"/> <fileset dir="${cxf.home}/lib"> <include name="*.jar"/> </fileset> </path> <target name="cxfJavaToWSDL"> <java classname="org.apache.cxf.tools.java2wsdl.JavaToWSDL" fork="true"> <arg value="-o"/> <arg value="hello.wsdl"/> <arg value="service.Greeter"/> <classpath> <path refid="cxf.classpath"/> </classpath> </java> </target> </project> Make sure you set the "fork=true" attribute for the <java/> task as shown above. Also, remember to keep each word or flag within the command line options in its own <arg/> element (e.g., do not use <arg value="-o hello.wsdl"/>, but split them up into two <arg/> elements as done here.) |
Unsubscribe or edit your notifications preferences
