You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Matthew Pocock <ma...@yahoo.co.uk> on 2003/10/23 16:31:49 UTC

ant tasks

Hi,

I've been having some problems with the axis ant tasks. We're running 
axis-1_1 and ant 1.5.1beta1 (should probably upgrade ant). We were doing 
everything by hand (running loads of different commands from a shell) 
and this worked ok, but now are trying to automate things and at the 
same time standardise on ant. We've run into a couple of snags which 
we'd apreciate help with.

Firstly, for the tasks axis-wsdl2java and axis-java2wsdl, how do I 
specify the classpath it should search for my web service classes? Since 
some of the classes are generated earlier in the ant script, they can't 
be in the classpath of the ant process itself. Neither ant task appears 
to have a classpath attribute.

Seccondly, we have written a custom serializer/deserializer for a 
data-type we are passing through an AXIS web service. I saw that you 
hook these in using <typeMapping> elements in the deploy.wsdd file. 
However, axis-wsdl2java, which seems to generate deploy.wsdd, doesn't 
seem to have any way to specify type mappings. It looks like the maping 
attributes are for assigning namespaces to packages, not to 
serializer/deserializer factory classes.

Oh, and the docs at 
http://ws.apache.org/axis/java/ant/axis-java2wsdl.html are badly 
formatted today (both in mozilla and explorer) - the tables containing 
the task properties have everything on one long line rather than in 
mulitple cells.

Thanks,

Matthew


Re: ant tasks

Posted by Stephen Gordon <st...@student.usyd.edu.au>.
With the first point, AFAIK there isn't a way to specify the classpath. 
You could however use the <java> task and call the WSDL2Java/Java2WSDL 
that way. A kludge for sure, but it would work ;)

stephen

Matthew Pocock wrote:

> Hi,
> 
> I've been having some problems with the axis ant tasks. We're running 
> axis-1_1 and ant 1.5.1beta1 (should probably upgrade ant). We were doing 
> everything by hand (running loads of different commands from a shell) 
> and this worked ok, but now are trying to automate things and at the 
> same time standardise on ant. We've run into a couple of snags which 
> we'd apreciate help with.
> 
> Firstly, for the tasks axis-wsdl2java and axis-java2wsdl, how do I 
> specify the classpath it should search for my web service classes? Since 
> some of the classes are generated earlier in the ant script, they can't 
> be in the classpath of the ant process itself. Neither ant task appears 
> to have a classpath attribute.
> 
> Seccondly, we have written a custom serializer/deserializer for a 
> data-type we are passing through an AXIS web service. I saw that you 
> hook these in using <typeMapping> elements in the deploy.wsdd file. 
> However, axis-wsdl2java, which seems to generate deploy.wsdd, doesn't 
> seem to have any way to specify type mappings. It looks like the maping 
> attributes are for assigning namespaces to packages, not to 
> serializer/deserializer factory classes.
> 
> Oh, and the docs at 
> http://ws.apache.org/axis/java/ant/axis-java2wsdl.html are badly 
> formatted today (both in mozilla and explorer) - the tables containing 
> the task properties have everything on one long line rather than in 
> mulitple cells.
> 
> Thanks,
> 
> Matthew
> 
> 
> 



Re: ant tasks

Posted by Mike Klein <mi...@sbcglobal.net>.
Actually...there is a way to specify the classpath...it's just not 
documented correctly in the ant tasks html on Axis web site.

I had this problem last night and thought...geez what an omission...I 
need to specify classpath before starting NetBeans/my IDE???

No, all is well...just use something like the following:

    <target depends="compile" description="Generate wsdl" name="java2wsdl">
        <axis-java2wsdl 
classname="com.vxappliance.quotations.QuotationService" 
namespace="urn:QuotationService" 
location="http://192.168.1.2:8080/axis/services/GetQuotation" 
output="${build}/generated/QuotationService.wsdl">
            <classpath>
                <pathelement location="${build}/classes"/>
            </classpath>
        </axis-java2wsdl>
    </target>


Hope this helps...

mike

Matthew Pocock wrote:

> Hi,
>
> I've been having some problems with the axis ant tasks. We're running 
> axis-1_1 and ant 1.5.1beta1 (should probably upgrade ant). We were 
> doing everything by hand (running loads of different commands from a 
> shell) and this worked ok, but now are trying to automate things and 
> at the same time standardise on ant. We've run into a couple of snags 
> which we'd apreciate help with.
>
> Firstly, for the tasks axis-wsdl2java and axis-java2wsdl, how do I 
> specify the classpath it should search for my web service classes? 
> Since some of the classes are generated earlier in the ant script, 
> they can't be in the classpath of the ant process itself. Neither ant 
> task appears to have a classpath attribute.
>
> Seccondly, we have written a custom serializer/deserializer for a 
> data-type we are passing through an AXIS web service. I saw that you 
> hook these in using <typeMapping> elements in the deploy.wsdd file. 
> However, axis-wsdl2java, which seems to generate deploy.wsdd, doesn't 
> seem to have any way to specify type mappings. It looks like the 
> maping attributes are for assigning namespaces to packages, not to 
> serializer/deserializer factory classes.
>
> Oh, and the docs at 
> http://ws.apache.org/axis/java/ant/axis-java2wsdl.html are badly 
> formatted today (both in mozilla and explorer) - the tables containing 
> the task properties have everything on one long line rather than in 
> mulitple cells.
>
> Thanks,
>
> Matthew
>
>



Re: ant tasks

Posted by Mike Klein <mi...@sbcglobal.net>.
Forgot to answer your second and third questions...

Yes, wsdl2java will generate deploy/undeploy.wsdd with type mappings 
(they could've used the simpler beanMapping element though).

      <typeMapping
        xmlns:ns="http://quotations.vxappliance.com"
        qname="ns:Quotation"
        type="java:com.vxappliance.quotations.Quotation"
        serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
        deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      />

As far as decent html for the ant tasks, check out the following under 
your ant source directory:

axis-1_1/docs/ant/axis-wsdl2java.html

They look fine, although they are incomplete descriptions as they don't 
mention the nested classpath element stuff from above.

cheers,

mike


Matthew Pocock wrote:

> Hi,
>
> I've been having some problems with the axis ant tasks. We're running 
> axis-1_1 and ant 1.5.1beta1 (should probably upgrade ant). We were 
> doing everything by hand (running loads of different commands from a 
> shell) and this worked ok, but now are trying to automate things and 
> at the same time standardise on ant. We've run into a couple of snags 
> which we'd apreciate help with.
>
> Firstly, for the tasks axis-wsdl2java and axis-java2wsdl, how do I 
> specify the classpath it should search for my web service classes? 
> Since some of the classes are generated earlier in the ant script, 
> they can't be in the classpath of the ant process itself. Neither ant 
> task appears to have a classpath attribute.
>
> Seccondly, we have written a custom serializer/deserializer for a 
> data-type we are passing through an AXIS web service. I saw that you 
> hook these in using <typeMapping> elements in the deploy.wsdd file. 
> However, axis-wsdl2java, which seems to generate deploy.wsdd, doesn't 
> seem to have any way to specify type mappings. It looks like the 
> maping attributes are for assigning namespaces to packages, not to 
> serializer/deserializer factory classes.
>
> Oh, and the docs at 
> http://ws.apache.org/axis/java/ant/axis-java2wsdl.html are badly 
> formatted today (both in mozilla and explorer) - the tables containing 
> the task properties have everything on one long line rather than in 
> mulitple cells.
>
> Thanks,
>
> Matthew
>
>