Categories
geekiness Uncategorized

Axis Deployment

Deploying an application to axis (“Axis of Evil”) is more complicated than one might think. First of course you need an application.

Step 1: Compile your app and put it in a jar-file. Copy the jar-file to the %tomcat_home%/webapps/axis/WEB-INF/lib/.
Step 2: Now you need to generate a WSDL spec from your code. Use Java2Wdsl for this. The fork in the ant target in the extended entry is important for me at least because otherwise java crashes because of library dependencies.
Step 3: From the wsdl file you have you now have to generate some java code, which is not needed. But with the -s parameter you also get the (un-)deployment descriptors needed for the axis AdminClient.
Step 3.5: Edit the deployment descriptor (deploy.wsdd) so that the classes referenced are your own not the generated ones.
Step 4: And finally you can use the deployment descriptor deploy.wsdd to deploy your app to axis and don’t forget to specify the port on which the AdminClient looks for axis if it is not the default 8080!

So this is it. Finally. Now I have to figure out some more details.

Here is a large part of my ant-file that does the deploying:
Target for wsdl generation:


<target name=”wsdl” depends=”init,jar”>
<mkdir dir=”${clientdir}”/>
<java classname=”org.apache.axis.wsdl.Java2WSDL” classpathref=”lib.path” classpath=”${dist}/${jarname}.jar” fork=”yes”>
<arg value=”-o${wsdl}”/>
<arg value=”-l${axishost}/axis/services/PublicInterface”/>
<arg value=”-nurn:${package}”/>
<arg value=”${package}.PublicInterface”/>
</java>
</target>

Java generation target / deploy.wsdd:


<target name=”client” depends=”wsdl”>
<java classname=”org.apache.axis.wsdl.WSDL2Java” classpathref=”lib.path” fork=”yes”>
<arg value=”-o${clientdir}”/>
<arg value=”-s”/>
<arg value=”${wsdl}”/>
</java>
</target>

Deploy target:


<target name=”deploy” depends=”prepare,client”>
<java classname=”org.apache.axis.client.AdminClient” classpathref=”lib.path”
fork=”yes”>
<arg value=”-p8180″/>
<arg value=”${clientdir}/${packagedir}/deploy.wsdd”/>
</java>
</target>

By Yashima

Writer of code and stories