0 Replies Latest reply on Jul 13, 2015 8:35 AM by megha m

    Setting soap address location for JBoss based EJB webservice

    megha m Newbie

      I want to control the "soap:address location" of JBoss EAP 5.1 deployed WSDL through application - an EJB based webservice.

       

      My WSDL (hard file) looks like this

       

      <wsdl:service name="ServiceName">
              <wsdl:port binding="abc:axy.0SOAP" name="ServicePort">
                  <soap:address location="http://localhost:8080/MyServices/MyService-3.0/ServiceManager" />
              </wsdl:port>
      </wsdl:service>
      

      To control this soap address location I have jbossws-cxf.xml under "\src\main\resources\META-INF\":

       

      <jaxws:server id="ServiceFace"
          address="http://loadbalancer:13250/MyServices/MyService-3.0/ServiceManager" depends-on="ServiceMBean">
      
          <jaxws:serviceBean>
              <ref bean="testbean" />
          </jaxws:serviceBean>
      
          <jaxws:invoker>
            <bean class='org.jboss.wsf.stack.cxf.InvokerEJB3'/>
          </jaxws:invoker>
      
      </jaxws:server>
      

      I also tried adding (but didn't work):

       

      <jaxws:endpoint
          id='ServiceFace'
          address='http://loadbalancer:13250/MyServices/MyService-3.0/ServiceManager'  
          implementor='com.test.WebServiceImpl'>
          <jaxws:invoker>
            <bean class='org.jboss.wsf.stack.cxf.InvokerEJB3'/>
          </jaxws:invoker>
        </jaxws:endpoint>
      

      The generated WSDL when deployed on JBoss looks something like this when instead it should show me my load balancer address as defined by me in the jbossws-cxf.xml:

       

      <wsdl:service name="ServiceName">
              <wsdl:port binding="abc:axy.0SOAP" name="ServicePort">
                  <soap:address location="http://127.0.0.1:8080/MyServices/MyService-3.0/ServiceManager"/>
              </wsdl:port>
      </wsdl:service>
      

      When JBoss starts I can see in the logs:

       

      11:33:30,834 INFO  [AddressRewritingEndpointInfo] Setting new service endpoint address in wsdl: http://localhost:8080/MyServices/MyService-3.0/ServiceManager
      11:33:31,956 INFO  [AddressRewritingEndpointInfo] Setting new service endpoint address in wsdl: http://127.0.0.1:8080/MyServices/MyService-3.0/ServiceManager
      11:33:31,972 INFO[ServerImpl] Setting the server's publish address to be http://loadbalancer:13250/MyServices/MyService-3.0/ServiceManager
      

       

      I can see that JBoss is setting the server publish address to the load balancer but not the endpoint address which is not helping my cause - to change the soap address location in the deployed WSDL.

       

      There is a workaround that I can change the following in jboss-beans.xml but I dont want to do that as multiple applications are residing on that Jboss server instance.

       

      <property name="webServiceHost">${jboss.bind.address}</property>
      <property name="modifySOAPAddress">true</property>
      

       

      Can anyone suggest me how I can control the server endpoint address?