Hi Everybody. This is my first post in my blog. This post contains how, we can use Axis2 framework for implementing web services.
First of all I will give you brief introduction about what is Axis2 and advantages of using Axis2 over other frameworks like Spring Web services, Metro web service framework. Axis2 is much matured web service framework when compared to others. It supports almost all WS standards; it supports HTTP, JMS and SMTP transport layers etc. AXIS2 is a framework for developing web services and it is a Web service/ SOAP / WSDL engine. If you previously used any other frameworks for developing web services you will really appreciate axis2 development team once you get used with axis2 because you don’t have to worry about how to develop a web service. Axis2 lets you concentrate on developing your business logic rather than kill yourself by writing huge amount of coding. Ok, I think I gave enough introductions about AXIS2 framework. Now let’s see an example of how can we develop a web service using a simple POJO class.
What this web service will do is echo back the given String.
Step1: Write a
Step1 : Write a java class which you want to expose as a webservice.
* @author : Narendra
* Operation in HellowWorld web service
* @param str
* : Takes a String
* @return : Given input string
public String echoHelloWorldService(String str)
Step2: write services.xml as follows.
This is a sample Web Services developed using Axis2
name=“HellowWorld”> tag indicates that the web service name is HellowWorld and <parameter
name=“ServiceClass”> indicated the fully classified class name of java class which is going to be exposed as a web service.
Step3: Place it in services Folder
Place this services.xml in a META-INF folder and aar it. I mean jar them and you can change file extension to aar.
That’s it. You are ready to deploy it. For additional info on this please refer to the following link http://axis.apache.org/axis2/java/core/docs/pojoguide.html