Categories
geekiness Uncategorized

Axis Deployment Part II

With a hint from the mailinglist – did I ever mention what a practical thing those mailinglists are – I finally realized what I should have realized 2 days ago: the generation of the deployment descriptor for axis is really not necessary. It is much more reliable to write the thing yourself instead of using the java2wsdl / wsdl2java mechanism, which not only produces overhead but errors as well. Using ant does not improve this. So here’s what I use now:

<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="YourService" provider="java:RPC">
<parameter name="className" value="your.package.yourClass"/>
<parameter name="allowedMethods" value="method1 method2 method3"/>
</service>
</deployment>

I wrote this and it works. Simply use this together with the AdminClient. Don’t forget to copy your jar-file or your classes to the correct location in the axis directory and you are all set. From a deployed service you can then generate a client using ant and wsdl2java

<java classname="org.apache.axis.wsdl.WSDL2Java" classpathref="lib.path" fork="yes">
<arg value="-o${src}"/>
<arg value="-p${clientpackage}"/>
<arg value="${endpoint}?wsdl"/>
</java>

And that is all you need. Of course you need a tomcat running to generate your client this way. Forget the java2wsdl part …….. and if you have a problem: go ask a mailinglist, 99% of the time they will know what you don’t. 🙂

By Yashima

Writer of code and stories