3 Replies Latest reply on Nov 16, 2009 5:10 AM by socallag

    Overriding the URL in the wsdl

    korebantic

      In our setup Apache is proxying requests to fuse-esb:

       

      https://server/myService     ===>   http//server:8092/myService

       

      In short, the URL that fuse-esb (cxf) believes it to be bound to on the server side is correct, but from the client perspective it is wrong. I realize that the client can override the URL, but it would be nice if the WSDL returned  from:

       

      http//server:8092/myService/?wsdl

       

      Responded with a service section like this:

       

        <wsdl:service name="myService">

          <wsdl:port binding="tns:mySOAPBinding" name="soap">

            <soap:address location="https://server/myService/" />

          </wsdl:port>

        </wsdl:service>

       

      Instead of this:

       

        <wsdl:service name="myService">

          <wsdl:port binding="tns:mySOAPBinding" name="soap">

            <soap:address location="http://server:8092/myService/" />

          </wsdl:port>

        </wsdl:service>

       

      Does anyone know how to do this? I haven't yet been able to at least figure out which class is actually sending the wsdl back in response to the http//server:8092/myService/?wsdl request. Any ideas?

        • 1. Re: Overriding the URL in the wsdl
          socallag

          Hi,

           

          You should be able to use the attribute publishedEndpointUrl to achieve this.

           

          http://fusesource.com/docs/framework/2.2/config_ref/http.cxf.apache.org.jax/element/endpoint.html

           

          Regards,

           

          Seán.

          • 2. Re: Overriding the URL in the wsdl
            korebantic

            Sean,

             

            So that's a setting in bean.xml?

             

               <cxfbc:consumer wsdl="classpath:myservice.wsdl"

                               useJBIWrapper="false"

                               publishedEndpointUrl="https://127.0.0.1/api/myService/"

                               targetService="tns:WebServicesRouter"/>

             

            When I try that I get a deployment error:

             

            Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'publishedEndpointUrl' of bean class : Bean property 'publishedEndpointUrl' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

            • 3. Re: Overriding the URL in the wsdl
              socallag

              Hi,

               

              Yes it is a setting in beans.xml but it needs to be configured under a jaxws:endpoint not directly by a cxfbc:consumer bean.

              The cxf-osgi example shipped with the ESB indicates how you could configure this.

               

              Under the cxfbc:consumer there is a busCfg which can be used to point at a bus configuration and under this the jaxws:endpoint could be configured, again the fuse-esb-4.x\examples\cxf-osgi\src\main\resources\META-INF\spring\beans.xml file is an example of such a bus configuration.

               

              Regards,

               

              Seán.