Thanks for the pointers guys. I'm ALMOST there! I added the classpathref to taskdef, but then ANT complained of not finding my service class. So I added <classpath> to the task:
<axis-java2wsdl classname="com.my.Service" location="${service_url}">
<classpath><pathelement location="."/></classpath>
</axis-java2wsdl>
But now I get a NullPointer
java.lang.NullPointerException
at java.util.StringTokenizer.<init>(StringTokenizer.java:119)
at java.util.StringTokenizer.<init>(StringTokenizer.java:135)
at org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask.execute(Java2WsdlAntTask.java:177)
at org.apache.tools.ant.Task.perform(Task.java:319)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:336)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:294)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:119)
BUILD FAILED
I examined Java2WsdlAntTask.java (cvs ver 1.14) and noticed the NPE is occuring because execute() is trying to StrTok the value of 'extraClasses', an attribute I did not set (do I need to?) So to circumvent the NPE, I added extraClasses="" attribute, but now I get this:
Java2WSDL com.overture.service.Advertiser
java.lang.NoClassDefFoundError: javax/xml/namespace/QName
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:1627)
at java.lang.Class.privateGetPublicMethods(Class.java:1655)
at java.lang.Class.getMethod0(Class.java:1744)
at java.lang.Class.getMethod(Class.java:963)
at org.apache.axis.wsdl.fromJava.Types.isEnumClass(Types.java:728)
at org.apache.axis.wsdl.fromJava.Types.makeTypeElement(Types.java:1255)
at org.apache.axis.wsdl.fromJava.Types.writeTypeForPart(Types.java:326)
at org.apache.axis.wsdl.fromJava.Emitter.writePartToMessage(Emitter.java:1272)
at org.apache.axis.wsdl.fromJava.Emitter.writeResponseMessage(Emitter.java:1132)
at org.apache.axis.wsdl.fromJava.Emitter.writeMessages(Emitter.java:884)
at org.apache.axis.wsdl.fromJava.Emitter.writePortType(Emitter.java:841)
at org.apache.axis.wsdl.fromJava.Emitter.getWSDL(Emitter.java:387)
at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:268)
at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:338)
at org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask.execute(Java2WsdlAntTask.java:249)
at org.apache.tools.ant.Task.perform(Task.java:319)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:336)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:294)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:119)
Running Ant is becoming more troublesome than it's worth; what other hoops do I have to jump through to get axis-java2wsdl task to work? Like I previously stated, I can generate the wsdl via commandline:
java org.apache.axis.wsdl.Java2WSDL com.my.Service test.wsdl
Am I missing any required attributes in Ant that are not required in the commandline?
Gene
btw, I'm running NetBeans 3.4, Ant 1.5.1 and Axisi 1.1beta on Windows XP.
Steve Loughran <[EMAIL PROTECTED]> wrote:
----- Original Message -----
From: "Chris Schaefer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 29, 2002 17:17
Subject: Re: axis ant task in netbeans
> Gene:
> you are very close.... it all has to do with classpaths and the
> stuff. Here's
> what I did in my build.xml. I had axis installed at /usr/local/axis
>
>
>
>
>
>
>
>
> This is including every jar in the axis subdirectory which is overkill,
but
> not bad that I know of except for efficiency reasons. I suspect you could
> provide a more explicit include and make stuff run a bit faster.
I am not sure it is that much overkill; the task depends on axis.jar,
commons-logging.jar, mybe wsdl4j.jar and indirectly on log4j though that is
not mandatory. the **/*.jar inclusion is the safest way to get all you need.
Also, if Netbeans is running Ant1.4.1 then I dont guarantee the tasks work.
They were built against ant1.5 and so may not be backwards compatible,
though I dont think there are any deliberate attempts to be incompatible.
-Steve