Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAX WS URL mapping

 
Rabi Kumar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to build a webservice using JAX-WS.

The endpoint URL of my service is like: http://host:port/contextroot/MyService

However, I would like to expose my service using the following URL: http://host:port/contextroot/services/MyService without changing the namespaces in WSDL.

Any help is appreciated.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Have you tried to modify the servlet-mapping in the web.xml deployment descriptor in the web service WAR (assuming you deploy the web service in a WAR)?
Best wishes!
 
Rabi Kumar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I deploy using EAR/war. However my web.xml is empty. I dont see my webservice defined as a servlet there.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Right, you do not need to define web services in the web.xml deployment descriptor, but if you have special requirements, like you seem to have, you can use the web.xml deployment descriptor.
Best wishes!
 
Rabi Kumar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed the contextroot in application.xml of EAR file as follows and I am able to achieve the desired behavior:

Old:
<contextroot>mycontextroot</contextroot>

New:
<contextroot>mycontextroot/services</contextroot>
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for sharing your solution!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic