function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ollie.ax81Ollie.ax81 

ant task for axis WSDL2Java for sforce

does anybody have ant configured to generate the sforce client code?

I found http://ws.apache.org/axis/java/ant/ant.html so I am looking for someone that already has this working...lazy for sure, but perhaps others would be interested.

thanks.

Message Edited by Ollie on 05-18-2005 11:10 AM

Ollie.ax81Ollie.ax81
Yea, this is what I came up with:
<property name="axis.home" location="/Java/axis-1_1/lib/" />
<path id="axis.classpath">
<fileset dir="${axis.home}">
<include name="*.jar" />
</fileset>
</path>
<taskdef resource="axis-tasks.properties" classpathref="axis.classpath" />
<property name="src" location="src" />
<property name="local.wsdl" location="enterprise.wsdl" />
<target name="axis-wsdl2java">
<axis-wsdl2java output="${src}"
testcase="true" verbose="true" url="${local.wsdl}">
<mapping namespace="http://axis.apache.org/ns/interop"
package="interop" />
</axis-wsdl2java>
</target>

Seems to work ok.

Ollie

Message Edited by Ollie on 05-19-2005 08:25 AM

Ollie.ax81Ollie.ax81
Well not so fast Ollie. The generated sources include the com.sforce.soap.partner package but NOT the com/sforce/soap/enterprise/ package

When I connect to salesforce it logs in and binds ok

Creating the binding to the web service...
LOGGING IN NOW....
The session id is: 0_cJEV9SIeQGeYjP.H8oKYqz97oSrUOLBJC2_.FHJVeMaw09UGEYGg8.bhzXXPELGdlJq0vtwlrXcVRYTFEgADteaH1xyGi1
The new server url is: https://na1-api.salesforce.com/services/Soap/c/5.0

only to throw a NoClassDefFound exception on

com/sforce/soap/enterprise/_SessionHeader

Is there a flag I am missing in the ant task shown above in this thread?
SuperfellSuperfell
Are you using Axis 1.1 ?
Ollie.ax81Ollie.ax81
Yes sorry Axis 1.1 and SForce 5 enterprise.wsdl
Ollie.ax81Ollie.ax81
I tried a different task and got past the problem.

Instead of using the axis task type, I just a task type as follows
<target name="java-wsdl2java">
<java
classname="org.apache.axis.wsdl.WSDL2Java"
fork="true"
failonerror="true"
classpathref="axis.classpath">
<arg value="-a" />
<arg value="--output" />
<arg file="${src}" />
<arg value="--verbose" />
<arg value="--package" />
<arg value="com.sforce.soap.enterprise" />
<arg value="--testCase" />
<arg file="${local.wsdl}" />

</java>
</target>

But I had to then go back to my code and change some of the imports as some packages no longer existed,
like enterprise.fault. and enterprise.sobject.