7 Replies Latest reply on Jul 6, 2016 6:45 PM by vatsanm

    Web Service Client Address rewriting in WildFly 9

    tomaz.zupan

      Is it possible to rewrite address for web service client in WildFly 9 configuration?

       

      I've tried

       

              <subsystem xmlns="urn:jboss:domain:webservices:2.0">
                  ...
                  <client-config name="custom-service">
                      <property name="javax.xml.ws.service.endpoint.address" value="http://www.myserver.com:7723/..."/>
                  </client-config>
              </subsystem>
      
      
      

       

      without success.

       

      It would be very nice if web service client address could be manged outside WAR archive as we use same WAR for different environments (development, test, production).

       

       

      Best Regards,

      Tomaz

        • 1. Re: Web Service Client Address rewriting in WildFly 9
          ctomc

          If you add

          <modify-wsdl-address>true</modify-wsdl-address>

          <wsdl-host>jbossws.undefined.host</wsdl-host>

          to subsystem config does it work?

          • 2. Re: Web Service Client Address rewriting in WildFly 9
            tomaz.zupan

            Nope. It doesn't work.

            I'm not sure, but I think, that this configuration is just for server endpoint WSDL address replacement.

             

            In my case, I have more client WS consumers, so I thought that for every client consumer I will create different client configuration in web service subsystem. But now I'm not sure if this kind of use is right.

            • 3. Re: Web Service Client Address rewriting in WildFly 9
              asoldano

              Tomaz Zupan wrote:

               

              Nope. It doesn't work.

              I'm not sure, but I think, that this configuration is just for server endpoint WSDL address replacement.

               

              In my case, I have more client WS consumers, so I thought that for every client consumer I will create different client configuration in web service subsystem. But now I'm not sure if this kind of use is right.

              Right, the section of subsystem config mentioned above is for server endpoint, so it's not what you're looking for.

              Regarding adding a javax.xml.ws.service.endpoint.address property to a client-config... I've never tried that but it seems a reasonable approach. Are you sure the custom-service config there is actually being applied to your client?

              Let me know and if the config is applied but still the prop is not passed to the client, I'll check and try reproducing the problem.

              1 of 1 people found this helpful
              • 4. Re: Web Service Client Address rewriting in WildFly 9
                asoldano

                Moreover, please specify the exact version of WildFly & JBossWS that you're using.

                • 5. Re: Web Service Client Address rewriting in WildFly 9
                  tomaz.zupan

                  I'm using standard WildFly 9.0.2.Final distribution with included JBossWS (If I'm not wrong, version 5.0.0.Final is included).

                   

                  I'm using the following WS client initialization code:

                   

                  LdapServices_Service ldapServices_service = new LdapServices_Service();
                  ldapAdapterPort = ldapServices_service.getLdapServicesEndpoint1();
                  
                  
                  
                  ClientConfigurer configurer = ClientConfigUtil.resolveClientConfigurer();
                  configurer.setConfigProperties(bindingProvider, null, "custom-service");
                  
                  


                  and also trying wit WS Feature:

                   

                  LdapServices_Service ldapServices_service = new LdapServices_Service();
                  ldapAdapterPort = ldapServices_service.getLdapServicesEndpoint1(new ClientConfigFeature(null, "custom-service", true));
                  


                  without success.


                  I also made a little debugging and I could see, that WS client configuration from WildFly server config is found.

                  • 6. Re: Web Service Client Address rewriting in WildFly 9
                    asoldano

                    OK, I've had a look and I see why the way you're trying to achieve this does not work. The properties specified in the client config ends up copied into the Apache CXF internal endpoint (org.apache.cxf.jaxws.support.JaxWsEndpointImpl), which is extracted from the JAX-WS client proxy instance. The javax.xml.ws.service.endpoint.address property is meant to be set on instances implementing JAX-WS BindingProvider interface (in your case, the ldapAdapterPort object). Setting the same property in the cxf internals has no effect.

                    This said, you approach for configuring that prop (and perhaps also the other BindingProvider standard props) makes sense, so perhaps you could open up a JBWS feature request jira and we could work on it for next release.

                    Thanks

                    • 7. Re: Web Service Client Address rewriting in WildFly 9
                      vatsanm

                      I have a similar issue but I am using Jboss 7.1.1 Final.

                      In my standalone.xml:

                      <subsystem xmlns="urn:jboss:domain:webservices:1.1">

                                  <modify-wsdl-address>true</modify-wsdl-address>

                                  <wsdl-host>jbossws.undefined.host</wsdl-host>

                                  <endpoint-config name="Standard-Endpoint-Config"/>

                                  <endpoint-config name="Recording-Endpoint-Config">

                                      <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_ MTOM">

                                          <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>

                                      </pre-handler-chain>

                                  </endpoint-config>

                              </subsystem>

                       

                      but in the console logs:

                      17:43:32,491 INFO  [org.jboss.wsf.stack.cxf.metadata.MetadataBuilder] (MSC service thread 1-8) Add Service

                      id=VecService

                      address=https://jbossws.undefined.host:8443/myservice/service/oas

                      implementor=my.service.example.VecService

                      invoker=org.jboss.wsf.stack.cxf.JBossWSInvoker

                      serviceName={http://my.service.example.com/}VecServiceService

                      portName={http://my.service.example.com/}VecServicePort

                      wsdlLocation=null

                      mtomEnabled=false

                       

                      What do I need to do in JB 7.1.1 verion to resolve it so that the end point URL for teh WSDL is the host name/port from te incoming request , similar to:

                      address=https://my.server.com/myservice/service/oas

                      The WSDL is getting created by JBoss at startup.