2 Replies Latest reply on Oct 15, 2012 10:38 AM by Kostas Papageorgiou

    Same ContextPath for SOAP service

    Kostas Papageorgiou Newbie

      I am trying to run a SOAP proxy server in switchyard. The proxy has to expose multiple web services.

       

       

       

      I have noticed that when I bind a service( eg. ReverseService) with the following switchyard.xml entry

      <sca:service name="ReverseService" promote="ReverseServiceComponent/ReverseService">

                  <soap:binding.soap>

                      <soap:wsdl>META-INF/wsdl/reverse.wsdl</soap:wsdl>

                  </soap:binding.soap>

              </sca:service>

       

       

      and the following service definition ( defined in the reverse.wsdl)

      ....

      <wsdl:service name="ReverseService">

              <wsdl:port name="ReverseServicePort" binding="tns:ReverseServiceBinding">

                  <soap:address location="http://localhost:23456/ReverseService"/>

              </wsdl:port>

          </wsdl:service>

      ...

       

       

       

      , the service is bound to address=http://localhost:8080/ReverseService/ReverseService.

       

      If I add a context path with the following configuration,

       

      <sca:service name="ReverseProxyService" promote="ReverseServiceComponent/ReverseProxyService">

                  <soap:binding.soap>

                      <soap:wsdl>META-INF/wsdl/reverse.wsdl</soap:wsdl>

                      <soap:contextPath>ws</soap:contextPath>

                  </soap:binding.soap>

              </sca:service>

       

       

       

      , the service is bound to address=http://localhost:8080/ws/ReverseService

       

      Till now everything good. Problem starts when I add a second service (eg CountingService) , that I wish to have the same context path

      <sca:service name="CountingService" promote="CountingServiceComponent/CountingService">

                  <soap:binding.soap>

                      <soap:wsdl>META-INF/wsdl/counting.wsdl</soap:wsdl>

                     <soap:contextPath>ws</soap:contextPath>

                  </soap:binding.soap>

              </sca:service>

       

       

      counting.wsdl

      ...

      <wsdl:service name="CountingService">

              <wsdl:port name="CountingServicePort" binding="tns:CountingServiceBinding">

                  <soap:address location="http://localhost:23456/CountingService"/>

              </wsdl:port>

          </wsdl:service>

      ...

       

       

       

      In this case I get the exception :

       

       

       

      MSC00001: Failed to start service jboss.deployment.unit."webservices-sw-1.0.0-SNAPSHOT.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.unit."webservices-sw-1.0.0-SNAPSHOT.jar".SwitchYardService: org.switchyard.component.soap.WebServicePublishException: java.lang.IllegalStateException: Endpoint already registered: jboss.ws:context=ws,endpoint=org.switchyard.component.soap.endpoint.BaseWebService

                at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:79)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_35]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_35]

                at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_35]

      Caused by: org.switchyard.component.soap.WebServicePublishException: java.lang.IllegalStateException: Endpoint already registered: jboss.ws:context=ws,endpoint=org.switchyard.component.soap.endpoint.BaseWebService

                at org.switchyard.component.soap.endpoint.JBossWSEndpointPublisher.publish(JBossWSEndpointPublisher.java:74)

                at org.switchyard.component.soap.InboundHandler.start(InboundHandler.java:101)

                at org.switchyard.deploy.internal.Deployment.deployServiceBindings(Deployment.java:487)

                at org.switchyard.deploy.internal.Deployment.start(Deployment.java:147)

                at org.switchyard.as7.extension.deployment.SwitchYardDeployment.start(SwitchYardDeployment.java:106)

                at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:72)

                ... 5 more

      Caused by: java.lang.IllegalStateException: Endpoint already registered: jboss.ws:context=ws,endpoint=org.switchyard.component.soap.endpoint.BaseWebService

                at org.jboss.ws.common.management.DefaultEndpointRegistry.register(DefaultEndpointRegistry.java:91)

                at org.jboss.ws.common.management.ManagedEndpointRegistry.register(ManagedEndpointRegistry.java:60)

                at org.jboss.as.webservices.publish.EndpointPublisherImpl.publish(EndpointPublisherImpl.java:116)

                at org.jboss.as.webservices.publish.EndpointPublisherImpl.publish(EndpointPublisherImpl.java:92)

                at org.jboss.as.webservices.publish.EndpointPublisherImpl.publish(EndpointPublisherImpl.java:87)

                at org.switchyard.component.soap.endpoint.JBossWSEndpoint.publish(JBossWSEndpoint.java:70)

                at org.switchyard.component.soap.endpoint.JBossWSEndpointPublisher.publish(JBossWSEndpointPublisher.java:69)

                ... 10 more

       

       

       

       

      The above error prevents me from configurating the endpoints of the webservice as required ( http://localhost:8080/ws/ReverseServicehttp://localhost:8080/ws/CountingService )

      Is it a known issue or could be problem with my configuration ?