5 Replies Latest reply on Nov 5, 2012 7:45 PM by ffang

    Camel route from NMR to cxf:bean

    arcaballero

      Hi,

       

      I want to expose a web service (provider). In addition, I need to use a client with another services, and I want the comunication by nmr.

       

      My configuration file is as follows:

       

      <cxf:cxfEndpoint id="test3_consumer" address="http://localhost:8076/test3"

      wsdlURL="http://www.webservicex.net/WeatherForecast.asmx?WSDL"

      serviceName="cc:WeatherForecast" serviceClass="net.webservicex.WeatherForecastSoap">

                 

                <cxf:properties>

                     <entry key="loggingFeatureEnabled" value="true" />

                </cxf:properties>

           </cxf:cxfEndpoint>

            

           <cxf:cxfEndpoint id="test3_nmr" address="nmr:test3"

                wsdlURL="http://www.webservicex.net/WeatherForecast.asmx?WSDL"

                serviceName="cc:WeatherForecast" serviceClass="net.webservicex.WeatherForecastSoap">

                 

                <cxf:properties>

                     <entry key="loggingFeatureEnabled" value="true" />

                </cxf:properties>

           </cxf:cxfEndpoint>

            

                      

           <cxf:cxfEndpoint id="test3_provider"

                address="http://www.webservicex.net/WeatherForecast.asmx" wsdlURL="http://www.webservicex.net/WeatherForecast.asmx?WSDL"

                serviceName="cc:WeatherForecast" serviceClass="net.webservicex.WeatherForecastSoap">

                <cxf:properties>

                     <entry key="loggingFeatureEnabled" value="true" />

                </cxf:properties>

           </cxf:cxfEndpoint>

            

            

           <jaxws:client id="client"

                serviceClass="net.webservicex.WeatherForecastSoap"

                serviceName="cc:WeatherForecast" address="nmr:test3">

                <jaxws:features>

                     <bean class="org.apache.cxf.feature.LoggingFeature" />

                </jaxws:features>

           </jaxws:client>

            

           <osgi:service id="proxyTest3" ref="client"

                interface="net.webservicex.WeatherForecastSoap" />

       

       

       

       

      <camelContext id="test3_route" xmlns="http://camel.apache.org/schema/spring">

       

                <route id="test3_route1" streamCache="true">

                     <from uri="cxf:bean:test3_consumer?dataFormat=MESSAGE" />

       

                     <to uri="cxf:bean:test3_provider?dataFormat=MESSAGE" />

                </route>

                 

                <route id="test3_route2" streamCache="true">

                     <from uri="nmr:test3" />

       

                     <to uri="cxf:bean:test3_provider?dataFormat=MESSAGE" />

                </route>

                 

      </camelContext>

       

      The error that I get is:

       

      javax.xml.ws.soap.SOAPFaultException: Could not find conduit initiator for address: nmr:test3 and transport: http://schemas.xmlsoap.org/soap/http

       

      regards

      Alex

        • 1. Re: Camel route from NMR to cxf:bean
          ffang

          Hi,

           

          Did you already add

           

           

          Freeman

          • 2. Re: Camel route from NMR to cxf:bean
            arcaballero

            I imported the resource that you told me. Now I get a new error:

             

            ERROR | xtenderThread-13 | ContextLoaderListener            | 85 - org.springframework.osgi.extender - 1.2.1 | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=service-test3-osgi-cxf, config=osgibundle:/META-INF/spring/*.xml))

            org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location classpath:META-INF/cxf/transport/nmr/cxf-transport-nmr.xml

            Offending resource: URL bundle://233.0:0/META-INF/spring/beans.xml; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from OSGi resource classpath:META-INF/cxf/transport/nmr/cxf-transport-nmr.xml|bnd.id=233|bnd.sym=service-test3-osgi-cxf; nested exception is java.io.FileNotFoundException: OSGi resource classpath:META-INF/cxf/transport/nmr/cxf-transport-nmr.xml|bnd.id=233|bnd.sym=service-test3-osgi-cxf cannot be resolved to URL because it does not exist

             

             

            regards,

             

            Alex

             

            Edited by: arcaballero on Nov 5, 2012 9:26 AM

            • 3. Re: Camel route from NMR to cxf:bean
              ffang

              Hi,

               

              Ensure you already installed cxf-nmr feature.

               

              Freeman

              • 4. Re: Camel route from NMR to cxf:bean
                arcaballero

                Hi,

                 

                Yes, the feature cxf-nmr is installed. My feature is as follows:

                 

                 

                • 5. Re: Camel route from NMR to cxf:bean
                  ffang

                  Hi,

                   

                  Also you need ensure your customer bundle import package META-INF.cxf.transport.nmr

                   

                  Freeman