Running using axis2 inside a WAR application
I am trying to add Axis2 parsing/handling to my existing web application. This compiles into a WAR file, however, my understanding (hopefully incorrect) of the Axis2 process is that to run it inside of a Tomcat server you need to install the Axis2.war servlet, and then compile the Axis2 application into an .aar file and place it in the $CATALINA_HOME/axis2/services subdirectory.
I need this to work compiled into a war file and put in a normal location.
From my understanding, to use Axis2 you need the servlet container to have a transport listener, which is the Axis2.war servlet. This will then delegate to the relevant installed .aar file. I have read a lot o开发者_如何学JAVAf the documentation and can't see how to make Axis2 more transparent.
Has anyone got any knowledge of this?
You can add the axis2 as a servlet of your current application . All you have to do is add to your web.xml something like this:
<servlet>
<servlet-name>AxisServlet</servlet-name>
<display-name>Apache-Axis Servlet</display-name>
<servlet-class>
org.apache.axis2.transport.http.AxisServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
And a mapping:
<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
Here is a guide for the configuration.
精彩评论