Search code examples
tomcatsoapapache-axis

How to specify relative path for axis2.xml for embedded axis2 in WAR application


I have embedded an axis2 webservice into a web application of mine. It works great as long as I don't need to specify the location of axis2.xml (i.e. if everything is left default for axis2 initialization).

However, I now need to modify the transporter to use my SOAP webservice over https. For this, I have 1) copied the axis2.xml file of a standalone axis2 distribution and stripped a lot of things from it and 2) modified my web.xml file like this after a lot of trials & error:

<servlet>
  <servlet-name>AxisServlet</servlet-name>
  <servlet-class>org.apache.axis2.transport.http.AxisServlet</servlet-class>
  <init-param>
    <param-name>axis2.xml.path</param-name>
    <param-value>webapps/MyApp/WEB-INF/conf/axis2.xml</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>
</servlet>

This worked (although I'm not satisfied at all with it) on every deployments I made but the last one (instead of installing tomcat through the package manager of ubuntu, I downloaded an archive and installed it manually).

I was not able to find out how (and if) it is possible to indicate a relative path (inside my war) for the axis2.xml How should one proceed?

Thanks for your help!


Solution

  • Apparently, not specifying the path and putting the file inside WEB-INF/conf/axis2.xml is enough to make it work. It might not have worked in the first place because my axis2.xml was not complete/valid.