|
ant member offline |
|
posts: |
20 |
joined: |
04/19/2010 |
from: |
San Jose, CA |
|
|
|
|
|
Axis2 |
What's Axis2?
Axis2 is a SOAP engine, and Axis2 is a Web Services engine, and Axis2 is a WSDL engine.
|
|
|
|
|
|
|
ant member offline |
|
posts: |
20 |
joined: |
04/19/2010 |
from: |
San Jose, CA |
|
|
|
|
|
Environment setup |
Before you can run Axis2 there is some set up you will need to do:
1) PATH -- Add the bin directory to your path. 2) AXIS2_HOME -- Set the AXIS2_HOME environment variable to the directory where you installed Ant. 3) JAVA_HOME -- Optionally, set the JAVA_HOME environment variable to the directory where your JDK is installed.
You can make the change statically via computer system administration or dynamically via command line settings which is good for the current CMD session:
set AXIS2_HOME=c:\axis2 set JAVA_HOME=c:\jdk-1.5.0.05 set PATH=%PATH%;%AXIS2_HOME%\bin
|
|
|
|
|
|
|
ant member offline |
|
posts: |
20 |
joined: |
04/19/2010 |
from: |
San Jose, CA |
|
|
|
|
|
Installation |
The are two ways to put Axis2 to work:
Way #1: Download the WAR (Web Archive) file axis2.war and put it in the WEBAPPS folder of your servlet container. The servcie can be reached by http://localhost:8080/axis2/
Way #2: Download the standard binary distribution and then:
2a) start a standalone Axis2 server via
%AXIS2_HOME%\bin\axis2server.bat (the deafult servcie can be reached by http://localhost:8080/axis2/services/)
2b) create a customized web application via
%AXIS2_HOME%\webapps>ant create.war
|
|
|
|
|
|
|
ant member offline |
|
posts: |
20 |
joined: |
04/19/2010 |
from: |
San Jose, CA |
|
|
|
|
|
Structure of axis2.war |
axis2-web
META-INF
WEB-INF
classes
conf
axis2.xml
lib
activation.jar
...
xmlSchema.jar
modules
modules.list
addressing.mar
...
soapmonitor.mar
services
services.list
aservice.aar
...
version.aar
web.xml
|
|
|
|
|
|
|
ant member offline |
|
posts: |
20 |
joined: |
04/19/2010 |
from: |
San Jose, CA |
|
|
|
|
|
Axis2 Servcie |
Axis2 Servcies can be deployed as *.aar files, which must be arranged in a specific way. For example, the structure of this service will be as follows:
- StockQuoteService
- META-INF
- services.xml
- lib
- samples
- quickstart
- service
- pojo
- StockQuoteService.class
Here, the name of the service is StockQuoteService. The services.xml file specifies the service that Axis2 needs to execute it properly and links the Java class to it. Very mauch the same way as in web.xml to specify the Servelt mapping.
Content of services.xml
<service name="StockQuoteService" scope="application">
<description>
Stock Quote Sample Service
</description>
<messageReceivers>
<messageReceiver
mep="http://www.w3.org/2004/08/wsdl/in-only"
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
<messageReceiver
mep="http://www.w3.org/2004/08/wsdl/in-out"
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</messageReceivers>
<parameter name="ServiceClass">
samples.quickstart.service.pojo.StockQuoteService
</parameter>
</service>
|
|
|
|
|
|
|
ant member offline |
|
posts: |
20 |
joined: |
04/19/2010 |
from: |
San Jose, CA |
|
|
|
|
|
How to deploy a web service? |
You can deploy a service in two ways:
Way #1 -- by exploded format: Simply drop the whole hierarchy of your service files to webapps/axis2/WEB-INF/services directory of your servlet engine.
Way #2 -- by compress format: Compress the whole hierarchy of your service files into an *.aar file, similar to a *.jar file, and then place it directly in the servlet engine's webapps/axis2/WEB-INF/services directory.
|
|
|
|
|
|
|