Monday, March 22, 2010

Generate Webservice proxy classes or client stub classes by ANT

For ANT build :

 set the <taskdef> for axis-wsdl2java

<taskdef resource="axis-tasks.properties" classpathref="axis.classpath" />

 Axis taskdefs :

 axis-wsdl2java=org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask
 axis-java2wsdl=org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask

create target for the wsdl2java

  <target name="wsdl2java-client" description="task">
    
    <axis-wsdl2java 

    output="${generated.dir}"

    testcase="true"

    serverside="false"

    verbose="true"
   
    url="http://sample.webservice?wsdl" >

</axis-wsdl2java>
    
    </target>

 attachment of sample code with ant
Reactions: