2 Replies Latest reply on Jan 4, 2008 10:40 AM by Richard Opalka

    contextRoot with multiple webservices

    Fabian Meystre Newbie

      I have some problem with the contextRoot with multiple WebService (in different apps) with same name on same server.
      I'm running JBoss AS 4.2.1.GA with jbossws-native-2.0.1.GA.

      I have 2 deployed web applications (same java source code)

      First application is deployed at http://host/myApp1
      Second application is deployed at http://host/myApp2

      context root is set in the web.xml.

      for myApp1:


      for myApp2:


      Everything is working fine with the web application (using Seam 1.2.1 GA).
      The problem is with the WebService :

      The 2 WebServices are deployed under default context root :


      When I try to invoke the WebService WSTest from one client on

      it invokes the wrong service on the other app:

      Why is the wrong service invoked?
      I tried to change the context root like this : @WebContext(authMethod = "BASIC", contextRoot="/myApp1" ) but then I can't open the Webservice on http://host/myApp1/WSTest, Error 404
      By the way @WebContext and contextRoot="myApp1" is not a good solution for me, Because 2 apps share the same java source. I need a more dynamic way to change this. I see that we can change the context-root in jboss.xml, but regarding this post it is
      not working : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078878#4078878

      here is my WebService, it use the EJB annotation

      @SOAPBinding(style = SOAPBinding.Style.RPC)
      @WebContext(authMethod = "BASIC", transportGuarantee = "NONE", secureWSDLAccess = false)
      public class WSTestBean implements WSTest{
       public void test(byte[] order) {

      For information I have user Seam-Gen to generate the project

      Thanks in advance for any help