Friday, January 15, 2010

Changing Axis2 application path

By default Axis2 generates an context path as follows when deployed it in tomcat or other application server.

http://localhost:8080/axis2/services/Version?wsdl

but most of the it is requried to customize this as follows.

http://localhost:8080/myApp/myServices/Version?wsdl

Below steps can be used to achive this.
1. Rename the web app name axis2 to myApp
2. Uncomment and edit the servicePath parameter at the axis2.xml file
myServices
3. Add the following entry to web.xml. Here we need to add this entry rather than chaing existing one since services part is hard coded in some places.

<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/myServices/*</url-pattern>
</servlet-mapping>

How to get a path like this?

http://localhost:8080/myServices/Version?wsdl

This can be done my making this application as ROOT app
1. change the myApp to ROOT

5 comments:

Anonymous said...

Thanks a lot. It was a breeze!

MANESH said...

Thanks a lot. It was a breeze

Anonymous said...

Hi Amila, I am trying to change the path service and I cant. I changed the web.xml and axl2.xml as you said but axis2 says "The service cannot be found for the endpoint reference (EPR) /NPM_API-11.1.1.4/auth/listServices".

Any ideas?

Thanks in advance.

Anonymous said...

Hi Amila, I am trying to change the path service and I cant. I changed the web.xml and axl2.xml as you said but axis2 says "The service cannot be found for the endpoint reference (EPR) /NPM_API-11.1.1.4/auth/listServices".

Any ideas?

Thanks in advance.

aditi rocks said...


hello,
I am facing a problem while connecting webservice client to webservice in java..and facing the following error message---

" [INFO] Unable to sendViaPost to url[https://ifc.int.hot-sos.net/api/service.svc/soap]
org.apache.axis2.AxisFault: Transport error: 404 Error: Not Found"

since I have access it with soapUI, but using SOAPUI the web service
works perfect.
Do you see where the problem may be?
I m using Axis 2