4 Replies Latest reply on Oct 27, 2009 12:36 PM by Dave Stanley

    CXF-BC consumer provider problem

    m k Newbie

      1. There is external wsdl file on my server

      2. The ESB is connecting to this wsdl

      3. I'm connecting to esb to retreve wsdl through ESB

       

      I've build cxf-bc service unit with xbean file like this:

       

       

       

      Is something missing in my xbean.xml ??

      What about if I don't have define name="" in wsdl file.  service="name:MyService" ??

      Am I missing xmlns??

       

      The main idea is to retrive or send information to external wsdl throught ESB.

       

      And main question: How can I test it to see how it works??

       

      MK

        • 1. Re: CXF-BC consumer provider problem
          Dave Stanley Novice

          Hi,

          You seem to be missing namespace prefixes for your targetService and targetInterface. If you look at one of the shipped samples with the ESB .. e.g.

           

          /examples/cxf-wsdl-first/wsdl-first-cxfbc-su/src/main/resource/xbean.xml

           

          you will see something like this ..

           

          
          <beans xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
                 xmlns:person="http://servicemix.apache.org/samples/wsdl-first">
          
            <cxfbc:consumer wsdl="classpath:person.wsdl"
                                targetService="person:PersonService"
                                targetInterface="person:Person"></cxfbc:consumer>
          
          </beans>
          

           

          Note the QName's for the service and interface need to match your wsdl.

           

          person namespace -  matches targetNamespace of the wsdl

          targetService - matches the wsdl:service name

          targetInterface - matches the portType name

           

          <wsdl:definitions name="wsdl-first"
               xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
               xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
               xmlns:xsd="http://www.w3.org/2001/XMLSchema"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:tns="http://servicemix.apache.org/samples/wsdl-first"
               xmlns:typens="http://servicemix.apache.org/samples/wsdl-first/types"
               targetNamespace="http://servicemix.apache.org/samples/wsdl-first">
          .....
           
             <wsdl:portType name="Person">
                    <wsdl:operation name="GetPerson">
                         <wsdl:input message="tns:GetPersonRequest"></wsdl:input>
                         <wsdl:output message="tns:GetPersonResponse"></wsdl:output>
                         <wsdl:fault name="UnknownPerson" message="tns:UnknownPersonFault"></wsdl:fault>
                    </wsdl:operation>
               </wsdl:portType>
          
          ....
             <wsdl:service name="PersonService">
                   <wsdl:port binding="tns:PersonSOAPBinding" name="soap">
                     <soap:address location="http://localhost:8092/PersonService/"></soap:address>
                 </wsdl:port>
             </wsdl:service>
          
          </wsdl:definitions>
          
          

           

           

          Hope this helps

          /Dave

          • 2. Re: CXF-BC consumer provider problem
            Dave Stanley Novice

            on the last question..

             

            >>> And main question: How can I test it to see how it works??

             

            You just need to send a message compliant with the wsdl  to your esb service endpoint, and you should see it passthru to the backend via your cxf-bc provider.

             

            An easy way to do this is to modify /examples/cxf-wsdl-first/client.html to send a message matching your wsdl.

             

            Regards

            /Dave

            • 3. Re: CXF-BC consumer provider problem
              m k Newbie

              Thank you!

               

              I'll be glad if you could explain me more.

               

              I defined new xbean.xml file:

               

               

                         <soap:address location="http://myserver.com/services/MyService" />

                     </wsdl:port>

              </wsdl:service>

               

              Is it correct?

               

              5. How can I connect to ESB endpoint and which one in provider is ESB endpoint?

               

              6. Is my way of thinking correct to achieve my aim?

               

              Thanks in advance,

              MK

              • 4. Re: CXF-BC consumer provider problem
                Dave Stanley Novice

                Hi MK,

                I sent a response on this thread. Let just use that one..

                 

                Regard

                /Dave