You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by am am <ak...@yahoo.com> on 2011/01/25 07:28:30 UTC

Embedding Axis2 in a web app (Updated subject to Axis2 just in case)

Hi,


I am trying to embed axis2 in a web application. I found and followed this 
article by Deepal Jayasinghe: 
http://www.developer.com/services/article.php/3777111/Embedding-Apache-Axis2-into-Existing-Applications.htm
 and by doing it exactly as is and placing an .aar service file in services, it 
worked (I saw the WSDL in the browser).
My problem is the following: is this the only way to embed axis in a web-app? 
I.e inside the WEB-INF of webapp I must copy  /conf/axis2.xml, /modules, /lib 
etc?
The reason I am asking is because I have seen an embedded app with the following 
setup:
TOMCAT-HOME
                          /MyApplication
                                    |
                                    /WEB-INF
                                                   |                          
            

                                                    web.xml
                                                    services.xml ---> refers to 
a service class e.g. com.x.y.z.serviceImp
                                                     axis2.xml
                                                    /lib
                                                          -axis and other jars
                                                          -myService.jar ---> 
Contains service com.x.y.z.serviceImp referred by services.xml
                                                    Other directories and files
This setup works and the only thing I noticed is that the web.xml contains the 
following:
<servlet>
        <servlet-name>SomeRandomWebService</servlet-name>
        <servlet-class>
            org.apache.axis.transport.http.AxisServlet
        </servlet-class>
    </servlet>
 
I mean that the servlet-class is NOT org.apache.axis2.transport.http.AxisServlet 
(but plain axis). Does this mean axis1?
Anyway I tried to replicate this setup but it was impossible. I kept getting 
either 404 errors or "org.apache.axis2.AxisFault: The AXIS engine could not find 
a target service to invoke!"error  by tweaking the setup in my attempt.
I think that I have big missunderstanding of axis concepts due to I am an axis 
starter.
Could someone please help me on this one?
How come, I can not do the same setup? Any info on this is highly welcome.

Thank you