2 Replies Latest reply on Jun 17, 2014 4:39 AM by Guillaume Grossetie

    How @WebServiceRef injection works with multiple @WebEndpoint

    Guillaume Grossetie Newbie



      I know this is a edge case but we are experiencing "random" behavior when using multiple @WebEndpoint (with the same class).

      WebService client :


      public class TestEndpointService extends Service {
        // ....
       @WebEndpoint(name = "TestEndpointPort")
       public TestEndpoint getTestEndpointPort() {
         return (TestEndpoint) super.getPort("TestEndpointPort", TestEndpoint.class);
        @WebEndpoint(name = "TestEndpointPort12")
        public TestEndpoint getTestEndpointPort() {
          return (TestEndpoint) super.getPort("TestEndpointPort12", TestEndpoint.class);


      TestEndpointPort stands for SOAP/HTTP 1.1

      TestEndpointPort12 stands for SOAP/HTTP 1.2


      Injection :


      private TestEndpoint testEndpoint;


      Recently the second @WebEnpoint was injected instead of the first (we noticed because the port name was wrong and the call failed) but we don't have a rational explanation.

      I know that we need to remove one method or to specify which port the container should use but I'm curious, how the container resolves this situation ? Is this resolved at runtime ? at deployment time ?

      We are using JBoss EAP 6.2.0.