- Axis requires an application server such as Tomcat or more precisely a servlet container. So the first step is to install the application server on which the web services will be deployed.
- To launch Axis, we will use the standard binary distribution provided by the Apache Software Foundation.
- So just unpack the compressed file ( axis2-1.4-bin.zip) to find all you need to launch Axis.
- Axis can be started in standolone mode this through the file $AXIS2_HOME\bin\axis2server.bat
- After launching Axis, you can see the list of services available in standalone mode through the following URL: http://localhost:8080/axis2/services/.
- To use Axis with an application server just follow the following steps:
- Unzip the distribution of Axis 2 from the axis2-1.4-bin.zip.
- Open the command prompt and type cd $AXIS2_HOME\axis2-1.4\webapp
- Install Ant 1.6.5 or later.
- Run the build.xml file with Ant.
- The Axis2.war file is generated under the /dist directory.
Place the axis2.war file in the webapps directory and restart the server.
Axis is a web application deployed under Tomcat. The axis2.war file contains alllib necessary for the creation and deployment of web services. The structure of axis2.war looks like this:
You can view the main page of the Axis application can be accessed here: [ http://localhost:8080/axis2/
To see the list of deployed services click on Services.
The Validate link will verify that all the required libraries by Axis, are present in the application.
Deploying Web Services
The Axis2 web services can be deployed as a *.aar files. The structute of a service is a follows:
refers to the service name, the same name must be indicated in the services.xml file. Classes are placed directly at the root, along with their packages. And the lib directory contains the *.jar
necessary to run the services. The services.xml file defines the service and it matches it with the appropriate Java class.
Creation of web service
The prototype of the next project shows how to create a web service. It is an eclipse project with the following structure:
The class associated with the web service can check the price of a product and update it.
In this project named as OwlianceWS
, a build.xml file exist in order to build the project through the ANT utility.
- a compile.service target for compilation,
- a generate.wsdl target to create the wsdl description associated with the web servcie
- a generate.service target that allows encapsulation of the Web service into a archive with the .aar extension.
To deploy the service simply place the .aar file in the following directory: "Webservices $TomeCat\ webapps\axis2\WEB-INF\services
" and restart the application server.
To test the service simply call the URL http://localhost:8080/axis2/services/CataloguePrix/getPrice?symbol=OWLT.
The result obtained is then:
Published by deri58
Latest update on March 22, 2013 at 06:30 AM by deri58.