Wednesday, January 27, 2010

Web Services using AXIS2

In this session I was trying to deploy a web service using Apache Axis2 in eclipse IDE.
Apache Axis2 can be downloaded from here. Here I used Axis2 1.5.1 which is the recently released version.
Apache tomcat server can be downloaded from here. Here I am using the newer version of Apache tomcat 6.0.16.
Eclipse IDE for java ee developers can be downloaded from here. It is a must to use eclipse j2ee platform here.
Then we can start our work......

Start eclipse.
  1. Set axis2 preference. navigate Window-->Preferences-->Web Services-->Axis2 Preferences-->Axis2 Runtime. Then set the Axis2 runtime location of downloaded Axis2 bin folder location. Click Ok.


  2. Then we must setup the web server which we use to deploy from. To do this....... right click on the Project Explorer pan-->New-->Other-->Server-->Server-->Next--> Select apache tomcat server according to the tomcat version. Click finish.



  3. Now its time to start the project..... Right click on the Project Explorer pan-->New-->Other-->Dynamic Web Project-->Next -->Name the project-->Click Finish.


  4. Next we create a java package in the previously created project by right click on the project name in the Project Explorer pan. This is the package which include our web service.
  5. Create a class in the package created on previous step and write the program in it.
  6. Right click on the class name in the Project Explorer pan-->Web Services-->Create Web Service.
  7. In the configuration set Web Service Runtime as Apache Axis2 and click Finish.
  8. Now the Web Service will create and deploy by the Apache tomcat server.
  9. You can see whether this work or not by visit localhost:8080/(Project name)-->Services Then it will show your public methods under your java class file name in which we implement the web service.
  10. If you want to see the wsdl file just click on the java class file name.





I will present how to create a client program which uses this web service later......

No comments:

Post a Comment