Archive for category Webservices

Axis2: Deploying webservice onto Axis2

1. Download Apache Axis2 war distribution and Axis2 Binary distribution as well. Axis2 can be downloaded from In this case, i used Axis2 1.6.1.

2. Download latest tomcat from and unzip onto c:\tomcatx. Lets assume it is c:\tomcat7

3. Unzip Axis2 war distribution, and copy axis2.war onto C:\tomcat7\webapps

4. open run command and navigate to C:\tomcat7\bin and start the tomcat by typing startup.bat

5. Upon starting the tomcat, you can notice that the axis2.war file that was copied earlier, gets exploded into directory structure. Later on, we want .aar file to be copied to C:\tomcat7\webapps\axis2\WEB-INF\services to deploy a webservice onto the tomcat server

6. Now lets start to build .aar file to be deployed onto the above directory. For this unzip the Axis2 binary distribution and extract it to a directory lets say, c:\axis2161 (i downloaded axis2-1.6.1-bin and named it accordingly)

7. Now, do not forget to set AXIS2_HOME environmental variable to point to C:\axis2161\ and also add %AXIS2_HOME%  to the path.

8. Our goal is to deploy the quickstart sample app that gets shipped with Axis2, onto application server.

9. If you do not have ant installed on your machine, download ant from, in our case it is ant

10. Set the environmental variable for ant, NOTE: Ant 1.8.2 has an issue with environmental variable setup, setup the system path variable directly as ;C:\ant182\bin;

11. Open run command, cd to c:\axis2161\samples\quickstart

12. quickstart example comes with ant build.xml, run the command ant generate.service. You should see build successful

c:\axis2161\samples\quickstart>ant generate.service
Buildfile: c:\axis2161\samples\quickstart\build.xml

[mkdir] Created dir: c:\axis2161\samples\quickstart\build\classes
[javac] c:\axis2161\samples\quickstart\build.xml:42: warning: ‘includeantrun
time’ was not set, defaulting to build.sysclasspath=last; set to false for repea
table builds
[javac] Compiling 1 source file to c:\axis2161\samples\quickstart\build\clas
[javac] Note: c:\axis2161\samples\quickstart\src\samples\quickstart\service\
pojo\ uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.

[copy] Copying 1 file to c:\axis2161\samples\quickstart\build\classes
[jar] Building jar: c:\axis2161\samples\quickstart\build\StockQuoteService
[copy] Copying 1 file to c:\axis2161\repository\services

Total time: 9 seconds

13. Navigate to URL and login with admin as login and axis2 as password

14. Under upload services at, upload the aar file generated in above step.

15. upon successful deployment of service, you should see the service under available services. If you are seeing the service to be in FAULT status, check my other post regarding version mismatch to resolve the issue.

16. Click on the service name, to get the WSDL

17. If you have SOAP UI or any other client, you can now test the generated WSDL and the services using the URL





Leave a comment