3

I have an EAR without a WAR but with an EJB-JAR. One EJB inside the JAR exposes a service with @WebService. All works, but I don't know how control the urlcontext of the exposed service. Now it's something like:

http://jbossServer/myearnamepackage-myjarnamepackage/myEndoint?wsdl

I would like it to be:

http://jbossServer/myservice/myEndoint?wsdl

Thanks in advance.

Piotr Nowicki
  • 17,914
  • 8
  • 63
  • 82
Kaltresian
  • 961
  • 3
  • 14
  • 32

1 Answers1

3

You can set the context root of your web service with the following annotations in your ejb3 bean:- @WebContext(contextRoot="/myservice", urlPattern="/myEndpoint")

This should make the web service wsdl bind to http://jbossServer/myservice/myEndpoint?wsdl

CoolBeans
  • 20,654
  • 10
  • 86
  • 101
  • org.jboss.wsf.spi.annotation.WebContext из jboss-specific annotation that enforces another jar dependency and weakens app's portability. – Vadzim Dec 13 '11 at 14:57
  • 1
    Since JBoss 5 the same can be done with in jboss.xml. See http://community.jboss.org/message/339266#339266. – Vadzim Dec 13 '11 at 15:03