Axis2

Deploy Axis2 into Tomcat
Download Axis2 standard binary distribution (axis2-1.4.1-bin.zip) from here

Download and install Ant (apache-ant-1.7.0-bin.zip) if it was not already installed

Create Axis2 war file

axis2-1.4.1\webapp>ant create.war

Generated: axis2-1.4.1\dist\axis2.war

Copy axis2-1.4.1\dist\axis2.war into the tomcat\webapps directory

Axis2 Home Page
URL: http://localhost:8080/axis2
Default admin login: admin/axis
Change admin user/pass: axis2.xml

Quick Start: StockQuoteService

Generate service

C:\Program Files\axis2-1.4.1\samples\quickstart>ant

Generated build\StockQuoteService.aar with the structure

META-INF\services.xml
samples\quickstart\service\pojo\StockQuoteService.class

services.xml:

<service name="StockQuoteService" scope="application" targetNamespace="http://quickstart.samples/">
    <description>
        Stock Quote 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>
    <schema schemaNamespace="http://quickstart.samples/xsd"/>
    <parameter name="ServiceClass">samples.quickstart.service.pojo.StockQuoteService</parameter>
</service>

Copy StockQuoteService.aar to C:\Program Files\apache-tomcat-5.5.27\webapps\axis2\WEB-INF\services

Creating Clients

Client generating methods
ADB (Axis databinding framework): simple but limited schema bindings. XML–>Java binding only.
XMLBeans: full schema binding support but more complex. XML–>Java binding only.
JiBX: full schema binding support, easy to use, two way XML <--> Java binding support. Can be complicated to setup.

I tried XMLBeans method and generated all Java classes but stumbled when creating client to communicate with web services. It doesn’t seem intuitive at all on how to use the generated classes. I’m putting Axis2 on the back burner for now and favor JAX-WS reference implementation (Metro). Here is an interesting post lauding the Metro.

This entry was posted in jax-rpc, jax-ws, soa. Bookmark the permalink.