go to  ForumEasy.com   
JavaPro  
 
 
   Home  |  MyForum  |  FAQ  |  Archive    You are not logged in. [Login] or [Register]  
Forum Home » Web Application Servers » Axis2
Email To Friend  |   Set Alert To This Topic Rewarding Points Availabe: 0 (What's this) New Topic  |   Post Reply
Author Topic: Axis2
ant
member
offline   
 
posts: 20
joined: 04/19/2010
from: San Jose, CA
  posted on: 04/21/2010 12:52:32 PM    Edit  |   Quote  |   Report 
Axis2
What's Axis2?

  • Axis2 is a SOAP engine, and
  • Axis2 is a Web Services engine, and
  • Axis2 is a WSDL engine.

  •  Profile | Reply Points Earned: 0
    ant
    member
    offline   
     
    posts: 20
    joined: 04/19/2010
    from: San Jose, CA
      posted on: 04/21/2010 12:58:28 PM    Edit  |   Quote  |   Report 
    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

  •  Profile | Reply Points Earned: 0
    ant
    member
    offline   
     
    posts: 20
    joined: 04/19/2010
    from: San Jose, CA
      posted on: 04/21/2010 01:01:01 PM    Edit  |   Quote  |   Report 
    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 

     Profile | Reply Points Earned: 0
    ant
    member
    offline   
     
    posts: 20
    joined: 04/19/2010
    from: San Jose, CA
      posted on: 04/21/2010 01:21:07 PM    Edit  |   Quote  |   Report 
    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
    

     Profile | Reply Points Earned: 0
    ant
    member
    offline   
     
    posts: 20
    joined: 04/19/2010
    from: San Jose, CA
      posted on: 04/21/2010 01:34:53 PM    Edit  |   Quote  |   Report 
    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>
    
    

     Profile | Reply Points Earned: 0
    ant
    member
    offline   
     
    posts: 20
    joined: 04/19/2010
    from: San Jose, CA
      posted on: 04/21/2010 02:35:42 PM    Edit  |   Quote  |   Report 
    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.

     Profile | Reply Points Earned: 0

     
    Powered by ForumEasy © 2003-2005, All Rights Reserved. | Privacy Policy | Terms of Use
     
    Get your own forum today. It's easy and free.