3 Replies Latest reply on Feb 24, 2009 10:02 AM by Ulhas Bhole

    Trying to use CXF Consumer and Provider

    Joe Alex Newbie

      Fuse 4.0.0.3 - I am trying to use the CXF Consumer and Provider as follows. I have an external webservice (for testing using HelloWorld jaxws webservice in a seperate su) which should be proxied via the BUS. When the client calls on localhost:8092/HelloWorldService the Consumer will proxy the call to the NMR and via the Provider proxy the call to the real webservice at 8080. The results are proxied back to the callee. Also assuming when the results comeback will be able to apply camel route with some xpath to inspect the message and add an additional message to a queue.

       

      HelloWorld webservice is deployed as a seperate su and is working fine at localhost:8080/cxf/HelloWorld. The wsdl is copied over.

       

      This is the contents of the xbean.xml. Everything gets deployed fine but I dont see the proxy endpoint at 8092 as expected. Please let me know what is it I am not doing correctly. I am stuck with this for sometime and is a crucial factor to decide on servicemix.

       

      <!-- receives from client wsdl has :8092/HelloWorldService and sends to NMR -->

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

           service="hello:HelloWorldService"

           endpoint="HelloWorldPort"

           targetEndpoint="HelloWorldPortProxy"

           targetService="hello:HelloWorldService"

              targetInterface="hello:HelloWorldPortType"                         

      />

       

      <!-- receives from NMR sends to remote provider at :8080/HelloWorld -->

      <cxfbc:provider wsdl="classpath:hello.wsdl"

           locationURI="http://localhost:8080/cxf/HelloWorld"

           service="hello:HelloWorldService"

           endpoint="HelloWorldPortProxy"

           interfaceName="hello:HelloWorldPortType"     

      />

        • 1. Re: Trying to use CXF Consumer and Provider
          Ulhas Bhole Novice

          can you tell us how you hello.wsdl looks like. I think the problem might be with the service name and endpoint names are same but need to looks at the wsdl to come to any conclusion.

          • 2. Re: Trying to use CXF Consumer and Provider
            Joe Alex Newbie

            Thanks ubhole. Please use the attached xbean.xml and hello.wsdl to check issues.

             

            The only difference in the real wsdl from the one in classpath is the entry <soap:address location="http://localhost:8092/HelloWorld" />. The actual webservice (the provider should be proxying to) is running at localhost:8080/cxf/HelloWorld.

             

            I am expecting the new consumer can be accessed by external clients at localhost:8092/HelloWorld and

            The Provider will look for the external webservice via the "locationURI" attribute in this case at localhost:8080/cxf/HelloWorld.

            • 3. Re: Trying to use CXF Consumer and Provider
              Ulhas Bhole Novice
              joealex3 wrote:

               

              This is the contents of the xbean.xml. Everything gets deployed fine but I dont see the proxy endpoint at 8092 as expected. Please let me know what is it I am not doing correctly. I am stuck with this for sometime and is a crucial factor to decide on servicemix.

               

              Hi Joealex3,

              Sorry for the delay I was trying something over this.

              I didn't get you when you say

              This is the contents of the xbean.xml. Everything gets deployed fine but I dont see the proxy endpoint at 8092 as expected.

               

              I tried modifying the standard cxf-wsdl-first sample and could get it to deploy and work fine with exactly similar contents to you xbean. Can you let me know How you are trying to verify the proxy endpoint?

               

              Also, Do you really need to use the same service and wsdl on both sides? when both servicemix consumer and provider both would register on NMR they would use the same QNAME for the service and this might be causing one overwriting other.

               

              some more insight into why need to use same wsdl with same namespace would be helpful.