suresh sahu
suresh sahu

Reputation: 51

How can I use WSDLToJava of Apache CXF in my Ant buildfile to create Java code from a WSDL?

How can I use WSDLToJava of Apache CXF in my Ant buildfile to create Java code from a WSDL?

Upvotes: 0

Views: 1897

Answers (1)

Lydia Ralph
Lydia Ralph

Reputation: 1473

There are several examples on the official Apache documentation page, e.g.:

<?xml version="1.0"?>
<project name="cxf wsdl2java" basedir=".">   
   <property name="cxf.home" location ="/usr/myapps/cxf-2.5.1"/>

   <path id="cxf.classpath">
      <fileset dir="${cxf.home}/lib">
         <include name="*.jar"/>
      </fileset>
   </path>

   <target name="cxfWSDLToJava">
      <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true">
         <arg value="-client"/>
         <arg value="-d"/>
         <arg value="src"/>
         <arg value="MyWSDL.wsdl"/>
         <classpath>
            <path refid="cxf.classpath"/>
         </classpath>
      </java>
   </target>
</project>

Please update your question to be more specific if this does not answer your question.

You will of course need to download CXF and set cxf.home to the relevant location, and set MyWSDL.wsdl to the path of your WSDL file.

Upvotes: 1

Related Questions