|
Page Edited :
CXF20DOC :
Java to WS
Java to WS has been edited by Glen Mazza (Feb 26, 2008). Change summary: Added an Ant example. (Under development) Synopsis java2ws -databinding <jaxb or aegis> -frontend <jaxws or simple> -wsdl -wrapperbean -client -server
-o <output-file> -d <resource-directory> -classdir <compile-classes-directory> -cp <class-path>
-soap12 -t <target-namespace> -beans <ppathname of the bean definition file>*
-servicename <service-name> -portname <port-name> -createxsdimports -h -v -verbose -quiet {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. If none of "-wsdl , - wrapperbean, -client, -server" flags are specified, java2ws will generate nothing. Using java2ws with AntThe java2ws command can be wrapped inside an Ant target as shown below: <?xml version="1.0"?> <project name="cxf java2ws" basedir="."> <property name="cxf.home" location ="/usr/myapps/cxf-trunk"/> <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="cxfJavaToWS"> <java classname="org.apache.cxf.tools.java2ws.JavaToWS" fork="true"> <arg value="-wsdl"/> <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
