Install and deploy Axis2 under Apache Tomcat
The following instructions will set up a working Apache Tomcat runtime, with Axis2 deployed. We also deploy an Axis2 sample service (Stock Quote Service), to prove that the setup works.
You can comment the document
here
.
Prerequisites
Make sure that
- Java Runtime Environment (JRE) > 1.5 is installed
- JAVA_HOME is set properly.
Create a working directory and go there.
Set up the environment
AXIS2_HOME=$PWD/axis2_java
export AXIS2_HOME
CATALINA_HOME=$PWD/apache-tomcat
export CATALINA_HOME
ANT_HOME=$PWD/apache-ant
export ANT_HOME
PATH=$ANT_HOME/bin:$PATH
export PATH
Install the required software
Install Apache Tomcat
wget http://apache.crihan.fr/dist/tomcat/tomcat-5/v5.5.27/bin/apache-tomcat-5.5.27.tar.gz
tar -zxf apache-tomcat-5.5.27.tar.gz
mv apache-tomcat-5.5.27 $CATALINA_HOME
Install Apache Ant
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.zip
unzip apache-ant-1.7.1-bin.zip
mv apache-ant-1.7.1 $ANT_HOME
Install and deploy Axis2
wget http://mirror.switch.ch/mirror/apache/dist/ws/axis2/1_4_1/axis2-1.4.1-bin.zip
unzip axis2-1.4.1-bin.zip
mv axis2-1.4.1 $AXIS2_HOME
pushd $AXIS2_HOME/webapp
ant create.war
mv $AXIS2_HOME/dist/axis2.war $CATALINA_HOME/webapps
$CATALINA_HOME/bin/catalina.sh start
popd
Check
http://localhost:8080/axis2
in your browser. The default Axis2 page should be visible.
Build and deploy a sample Axis2 service
cd $AXIS2_HOME/samples/quickstartadb
ant generate.service
cp $AXIS2_HOME/samples/quickstartadb/build/service/build/lib/StockQuoteService.aar $CATALINA_HOME/webapps/axis2/WEB-INF/services
Check
http://localhost:8080/axis2/services/listServices
in your browser. StockQuoteService must be listed with Service Status: Active.
Build and run the client
cd $AXIS2_HOME/samples/quickstartadb
ant run.client
The last lines of the output must be:
[java] 42.0
[java] price updated
[java] 42.35
--
ZsoltMolnar - 18 Feb 2009