You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by pevgen <pe...@km.ru> on 2009/01/23 17:16:27 UTC

cxf spring configuration (camel 1.5.0)

Hello.

I try to configurate a cxf-endpoint in a spring config. But i got error 
"org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean
named 'serviceEndpoint' must be of type [org.apache.camel.Endpoint], but was
actually of type [org.apache.camel.component.cxf.spring.CxfEndpointBean]"

config.xml :

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:jaxws="http://cxf.apache.org/jaxws"
       xmlns:cxf="http://activemq.apache.org/camel/schema/cxfEndpoint"
        
       xmlns:camel="http://activemq.apache.org/camel/schema/spring"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
       http://activemq.apache.org/camel/schema/cxfEndpoint
http://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd
       http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

    <import resource="classpath:META-INF/cxf/cxf.xml"/>
    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>

    <cxf:cxfEndpoint name="serviceEndpoint" id="serviceEndpoint"
address="/incident"
                serviceClass="ru.transsys.testcxf.TestEndpointImpl"/>
                <!--endpointName="s:TestEndpointPort"-->
                <!--serviceName="s:TestEndpointService"-->
            <!--xmlns:s="http://test.transsys.ru" />-->
    

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

        <route>
            <from ref="serviceEndpoint"/>
            <to id="aq1_In" uri="file:c:\temp\in"/>
        </route>
    </camel:camelContext>

    <!-- implementation of the webservice -->
    <bean id="testEndpoint" class="ru.transsys.testcxf.TestEndpointImpl"/>

</beans>

what do you think about it ?

thanks,
Evgeny

-- 
View this message in context: http://www.nabble.com/cxf-spring-configuration-%28camel-1.5.0%29-tp21627432s22882p21627432.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: cxf spring configuration (camel 1.5.0)

Posted by pevgen <pe...@km.ru>.
Willem, thank you for your response.

Evgeny  
-- 
View this message in context: http://www.nabble.com/cxf-spring-configuration-%28camel-1.5.0%29-tp21627432s22882p21661767.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: cxf spring configuration (camel 1.5.0)

Posted by Willem Jiang <wi...@gmail.com>.
Hi William

Thanks for clean up the mass that I made.

Happy Chinese new year to you and your famaly :)

Willem


On Tue, Jan 27, 2009 at 12:12 PM, William Tam <em...@gmail.com> wrote:

> Willem, nevermind.  It's been fixed.
>
> On Sun, Jan 25, 2009 at 11:53 PM, William Tam <em...@gmail.com>
> wrote:
> > Hi Willem,
> > Some cxf tests are failing due to class cast exception in
> > CxfEndpointBeanDefinitionParser.doParse()
> >        Map map = (Map)
> >
> bean.getBeanDefinition().getPropertyValues().getPropertyValue("properties");
> > Try running org.apache.camel.component.cxf.CxfWsdlFirstTest.
> > Could you take a look?  Thx.
> >
> >
> >
> > On Sun, Jan 25, 2009 at 3:08 AM, Willem Jiang <wi...@gmail.com>
> wrote:
> >> Hi William,
> >>
> >> Yes, I should set the beanId when I create the CxfSpringEndpont. I just
> >> committed a quick fix for it.
> >>
> >> Let me explain it , Camel's converter has this kind of magic that will
> >> turn a CxfSpringEndpointBean into a camel Endpoint, that's can make the
> >> configuration more easier (don't need to specify the 'cxf:bean'), and
> >> this magic can also help us to turn a Spring Integration Channel into a
> >> Spring Integration Endpoint etc.
> >>
> >> So the endpoint can be created by other not just by the component :)
> >>
> >> Willem
> >>
> >>
> >> William Tam wrote:
> >>> Let me ask a dumb question.  What is the benefit of doing this?
> >>> What's wrong with using "from" URI "cxf:bean:<beanId>" and let the
> >>> CxfComponent construct the endpoint?  I thought endpoint was always
> >>> created by a component(?)  Why we want to bypass all of that? Now, I
> >>> think the CxfEndpoint may have a null component which could cause
> >>> problem.  And, CxfSpringEndpoint may have empty beanId field which is
> >>> used by the configure() method.
> >>>
> >>>
> >>> On Sat, Jan 24, 2009 at 6:00 AM, Willem Jiang <wi...@gmail.com>
> wrote:
> >>>> Since there are huge changes between the camel 2.0 and camel 1.6 in
> >>>> camel-cxf module. I just commit a quick of CAMEL-1294 in Camel 2.0.
> >>>>
> >>>> Now you can define the rule like this in CAMEL 2.0-SNAPSHOT.
> >>>> <camel:camelContext
> >>>>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
> >>>>  useJmx="false">
> >>>>          <route>
> >>>>              <from uri="serviceEndpoint"/>
> >>>>              <to id="aq1_In" uri="file:c:\temp\in"/>
> >>>>          </route>
> >>>>    </camel:camelContext>
> >>>>
> >>>> NOTE: we don't support use ref bean in the camel rule, since the auto
> >>>> converting work can't be done in that case.
> >>>>
> >>>> Willem
> >>>> Willem Jiang wrote:
> >>>>> I just created a JIRA[1] for it, it should be fixed in the coming up
> >>>>> CAMEL 1.6.
> >>>>>
> >>>>> [1]https://issues.apache.org/activemq/browse/CAMEL-1294
> >>>>>
> >>>>> Willem
> >>>>>
> >>>>> Willem Jiang wrote:
> >>>>>> Hi,
> >>>>>>
> >>>>>> Current cxfEndpoint can't be directly used as a camel Endpoint.
> >>>>>> You need to change your camel context
> >>>>>>
> >>>>>>  <camel:camelContext
> >>>>>>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
> >>>>>>  useJmx="false">
> >>>>>>
> >>>>>>          <route>
> >>>>>>              <from uri="cxf:bean:serviceEndpoint"/>
> >>>>>>              <to id="aq1_In" uri="file:c:\temp\in"/>
> >>>>>>          </route>
> >>>>>>    </camel:camelContext>
> >>>>>>
> >>>>>> Willem
> >>>>>>
> >>>>>>
> >>>>>> pevgen wrote:
> >>>>>>> Hello.
> >>>>>>>
> >>>>>>> I try to configurate a cxf-endpoint in a spring config. But i got
> error
> >>>>>>> "org.springframework.beans.factory.BeanNotOfRequiredTypeException:
> Bean
> >>>>>>> named 'serviceEndpoint' must be of type
> [org.apache.camel.Endpoint], but was
> >>>>>>> actually of type
> [org.apache.camel.component.cxf.spring.CxfEndpointBean]"
> >>>>>>>
> >>>>>>> config.xml :
> >>>>>>>
> >>>>>>> <?xml version="1.0" encoding="UTF-8"?>
> >>>>>>> <beans xmlns="http://www.springframework.org/schema/beans"
> >>>>>>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >>>>>>>        xmlns:jaxws="http://cxf.apache.org/jaxws"
> >>>>>>>        xmlns:cxf="
> http://activemq.apache.org/camel/schema/cxfEndpoint"
> >>>>>>>
> >>>>>>>        xmlns:camel="http://activemq.apache.org/camel/schema/spring
> "
> >>>>>>>        xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> >>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
> >>>>>>>        http://activemq.apache.org/camel/schema/spring
> >>>>>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
> >>>>>>>        http://activemq.apache.org/camel/schema/cxfEndpoint
> >>>>>>> http://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd
> >>>>>>>        http://cxf.apache.org/jaxws
> http://cxf.apache.org/schemas/jaxws.xsd">
> >>>>>>>
> >>>>>>>     <import resource="classpath:META-INF/cxf/cxf.xml"/>
> >>>>>>>     <import
> resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
> >>>>>>>     <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
> >>>>>>>
> >>>>>>>     <cxf:cxfEndpoint name="serviceEndpoint" id="serviceEndpoint"
> >>>>>>> address="/incident"
> >>>>>>>
> serviceClass="ru.transsys.testcxf.TestEndpointImpl"/>
> >>>>>>>                 <!--endpointName="s:TestEndpointPort"-->
> >>>>>>>                 <!--serviceName="s:TestEndpointService"-->
> >>>>>>>             <!--xmlns:s="http://test.transsys.ru" />-->
> >>>>>>>
> >>>>>>>
> >>>>>>>     <camel:camelContext
> >>>>>>> xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
> >>>>>>> useJmx="false">
> >>>>>>>
> >>>>>>>         <route>
> >>>>>>>             <from ref="serviceEndpoint"/>
> >>>>>>>             <to id="aq1_In" uri="file:c:\temp\in"/>
> >>>>>>>         </route>
> >>>>>>>     </camel:camelContext>
> >>>>>>>
> >>>>>>>     <!-- implementation of the webservice -->
> >>>>>>>     <bean id="testEndpoint"
> class="ru.transsys.testcxf.TestEndpointImpl"/>
> >>>>>>>
> >>>>>>> </beans>
> >>>>>>>
> >>>>>>> what do you think about it ?
> >>>>>>>
> >>>>>>> thanks,
> >>>>>>> Evgeny
> >>>>>>>
> >>>>>
> >>>>
> >>>
> >>
> >>
> >
>

Re: cxf spring configuration (camel 1.5.0)

Posted by William Tam <em...@gmail.com>.
Willem, nevermind.  It's been fixed.

On Sun, Jan 25, 2009 at 11:53 PM, William Tam <em...@gmail.com> wrote:
> Hi Willem,
> Some cxf tests are failing due to class cast exception in
> CxfEndpointBeanDefinitionParser.doParse()
>        Map map = (Map)
> bean.getBeanDefinition().getPropertyValues().getPropertyValue("properties");
> Try running org.apache.camel.component.cxf.CxfWsdlFirstTest.
> Could you take a look?  Thx.
>
>
>
> On Sun, Jan 25, 2009 at 3:08 AM, Willem Jiang <wi...@gmail.com> wrote:
>> Hi William,
>>
>> Yes, I should set the beanId when I create the CxfSpringEndpont. I just
>> committed a quick fix for it.
>>
>> Let me explain it , Camel's converter has this kind of magic that will
>> turn a CxfSpringEndpointBean into a camel Endpoint, that's can make the
>> configuration more easier (don't need to specify the 'cxf:bean'), and
>> this magic can also help us to turn a Spring Integration Channel into a
>> Spring Integration Endpoint etc.
>>
>> So the endpoint can be created by other not just by the component :)
>>
>> Willem
>>
>>
>> William Tam wrote:
>>> Let me ask a dumb question.  What is the benefit of doing this?
>>> What's wrong with using "from" URI "cxf:bean:<beanId>" and let the
>>> CxfComponent construct the endpoint?  I thought endpoint was always
>>> created by a component(?)  Why we want to bypass all of that? Now, I
>>> think the CxfEndpoint may have a null component which could cause
>>> problem.  And, CxfSpringEndpoint may have empty beanId field which is
>>> used by the configure() method.
>>>
>>>
>>> On Sat, Jan 24, 2009 at 6:00 AM, Willem Jiang <wi...@gmail.com> wrote:
>>>> Since there are huge changes between the camel 2.0 and camel 1.6 in
>>>> camel-cxf module. I just commit a quick of CAMEL-1294 in Camel 2.0.
>>>>
>>>> Now you can define the rule like this in CAMEL 2.0-SNAPSHOT.
>>>> <camel:camelContext
>>>>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>>  useJmx="false">
>>>>          <route>
>>>>              <from uri="serviceEndpoint"/>
>>>>              <to id="aq1_In" uri="file:c:\temp\in"/>
>>>>          </route>
>>>>    </camel:camelContext>
>>>>
>>>> NOTE: we don't support use ref bean in the camel rule, since the auto
>>>> converting work can't be done in that case.
>>>>
>>>> Willem
>>>> Willem Jiang wrote:
>>>>> I just created a JIRA[1] for it, it should be fixed in the coming up
>>>>> CAMEL 1.6.
>>>>>
>>>>> [1]https://issues.apache.org/activemq/browse/CAMEL-1294
>>>>>
>>>>> Willem
>>>>>
>>>>> Willem Jiang wrote:
>>>>>> Hi,
>>>>>>
>>>>>> Current cxfEndpoint can't be directly used as a camel Endpoint.
>>>>>> You need to change your camel context
>>>>>>
>>>>>>  <camel:camelContext
>>>>>>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>>>>  useJmx="false">
>>>>>>
>>>>>>          <route>
>>>>>>              <from uri="cxf:bean:serviceEndpoint"/>
>>>>>>              <to id="aq1_In" uri="file:c:\temp\in"/>
>>>>>>          </route>
>>>>>>    </camel:camelContext>
>>>>>>
>>>>>> Willem
>>>>>>
>>>>>>
>>>>>> pevgen wrote:
>>>>>>> Hello.
>>>>>>>
>>>>>>> I try to configurate a cxf-endpoint in a spring config. But i got error
>>>>>>> "org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean
>>>>>>> named 'serviceEndpoint' must be of type [org.apache.camel.Endpoint], but was
>>>>>>> actually of type [org.apache.camel.component.cxf.spring.CxfEndpointBean]"
>>>>>>>
>>>>>>> config.xml :
>>>>>>>
>>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>> <beans xmlns="http://www.springframework.org/schema/beans"
>>>>>>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>>>        xmlns:jaxws="http://cxf.apache.org/jaxws"
>>>>>>>        xmlns:cxf="http://activemq.apache.org/camel/schema/cxfEndpoint"
>>>>>>>
>>>>>>>        xmlns:camel="http://activemq.apache.org/camel/schema/spring"
>>>>>>>        xsi:schemaLocation="http://www.springframework.org/schema/beans
>>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>>>>>>        http://activemq.apache.org/camel/schema/spring
>>>>>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
>>>>>>>        http://activemq.apache.org/camel/schema/cxfEndpoint
>>>>>>> http://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd
>>>>>>>        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
>>>>>>>
>>>>>>>     <import resource="classpath:META-INF/cxf/cxf.xml"/>
>>>>>>>     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
>>>>>>>     <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
>>>>>>>
>>>>>>>     <cxf:cxfEndpoint name="serviceEndpoint" id="serviceEndpoint"
>>>>>>> address="/incident"
>>>>>>>                 serviceClass="ru.transsys.testcxf.TestEndpointImpl"/>
>>>>>>>                 <!--endpointName="s:TestEndpointPort"-->
>>>>>>>                 <!--serviceName="s:TestEndpointService"-->
>>>>>>>             <!--xmlns:s="http://test.transsys.ru" />-->
>>>>>>>
>>>>>>>
>>>>>>>     <camel:camelContext
>>>>>>> xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>>>>> useJmx="false">
>>>>>>>
>>>>>>>         <route>
>>>>>>>             <from ref="serviceEndpoint"/>
>>>>>>>             <to id="aq1_In" uri="file:c:\temp\in"/>
>>>>>>>         </route>
>>>>>>>     </camel:camelContext>
>>>>>>>
>>>>>>>     <!-- implementation of the webservice -->
>>>>>>>     <bean id="testEndpoint" class="ru.transsys.testcxf.TestEndpointImpl"/>
>>>>>>>
>>>>>>> </beans>
>>>>>>>
>>>>>>> what do you think about it ?
>>>>>>>
>>>>>>> thanks,
>>>>>>> Evgeny
>>>>>>>
>>>>>
>>>>
>>>
>>
>>
>

Re: cxf spring configuration (camel 1.5.0)

Posted by William Tam <em...@gmail.com>.
Hi Willem,
Some cxf tests are failing due to class cast exception in
CxfEndpointBeanDefinitionParser.doParse()
        Map map = (Map)
bean.getBeanDefinition().getPropertyValues().getPropertyValue("properties");
Try running org.apache.camel.component.cxf.CxfWsdlFirstTest.
Could you take a look?  Thx.



On Sun, Jan 25, 2009 at 3:08 AM, Willem Jiang <wi...@gmail.com> wrote:
> Hi William,
>
> Yes, I should set the beanId when I create the CxfSpringEndpont. I just
> committed a quick fix for it.
>
> Let me explain it , Camel's converter has this kind of magic that will
> turn a CxfSpringEndpointBean into a camel Endpoint, that's can make the
> configuration more easier (don't need to specify the 'cxf:bean'), and
> this magic can also help us to turn a Spring Integration Channel into a
> Spring Integration Endpoint etc.
>
> So the endpoint can be created by other not just by the component :)
>
> Willem
>
>
> William Tam wrote:
>> Let me ask a dumb question.  What is the benefit of doing this?
>> What's wrong with using "from" URI "cxf:bean:<beanId>" and let the
>> CxfComponent construct the endpoint?  I thought endpoint was always
>> created by a component(?)  Why we want to bypass all of that? Now, I
>> think the CxfEndpoint may have a null component which could cause
>> problem.  And, CxfSpringEndpoint may have empty beanId field which is
>> used by the configure() method.
>>
>>
>> On Sat, Jan 24, 2009 at 6:00 AM, Willem Jiang <wi...@gmail.com> wrote:
>>> Since there are huge changes between the camel 2.0 and camel 1.6 in
>>> camel-cxf module. I just commit a quick of CAMEL-1294 in Camel 2.0.
>>>
>>> Now you can define the rule like this in CAMEL 2.0-SNAPSHOT.
>>> <camel:camelContext
>>>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>  useJmx="false">
>>>          <route>
>>>              <from uri="serviceEndpoint"/>
>>>              <to id="aq1_In" uri="file:c:\temp\in"/>
>>>          </route>
>>>    </camel:camelContext>
>>>
>>> NOTE: we don't support use ref bean in the camel rule, since the auto
>>> converting work can't be done in that case.
>>>
>>> Willem
>>> Willem Jiang wrote:
>>>> I just created a JIRA[1] for it, it should be fixed in the coming up
>>>> CAMEL 1.6.
>>>>
>>>> [1]https://issues.apache.org/activemq/browse/CAMEL-1294
>>>>
>>>> Willem
>>>>
>>>> Willem Jiang wrote:
>>>>> Hi,
>>>>>
>>>>> Current cxfEndpoint can't be directly used as a camel Endpoint.
>>>>> You need to change your camel context
>>>>>
>>>>>  <camel:camelContext
>>>>>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>>>  useJmx="false">
>>>>>
>>>>>          <route>
>>>>>              <from uri="cxf:bean:serviceEndpoint"/>
>>>>>              <to id="aq1_In" uri="file:c:\temp\in"/>
>>>>>          </route>
>>>>>    </camel:camelContext>
>>>>>
>>>>> Willem
>>>>>
>>>>>
>>>>> pevgen wrote:
>>>>>> Hello.
>>>>>>
>>>>>> I try to configurate a cxf-endpoint in a spring config. But i got error
>>>>>> "org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean
>>>>>> named 'serviceEndpoint' must be of type [org.apache.camel.Endpoint], but was
>>>>>> actually of type [org.apache.camel.component.cxf.spring.CxfEndpointBean]"
>>>>>>
>>>>>> config.xml :
>>>>>>
>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>> <beans xmlns="http://www.springframework.org/schema/beans"
>>>>>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>>        xmlns:jaxws="http://cxf.apache.org/jaxws"
>>>>>>        xmlns:cxf="http://activemq.apache.org/camel/schema/cxfEndpoint"
>>>>>>
>>>>>>        xmlns:camel="http://activemq.apache.org/camel/schema/spring"
>>>>>>        xsi:schemaLocation="http://www.springframework.org/schema/beans
>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>>>>>        http://activemq.apache.org/camel/schema/spring
>>>>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
>>>>>>        http://activemq.apache.org/camel/schema/cxfEndpoint
>>>>>> http://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd
>>>>>>        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
>>>>>>
>>>>>>     <import resource="classpath:META-INF/cxf/cxf.xml"/>
>>>>>>     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
>>>>>>     <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
>>>>>>
>>>>>>     <cxf:cxfEndpoint name="serviceEndpoint" id="serviceEndpoint"
>>>>>> address="/incident"
>>>>>>                 serviceClass="ru.transsys.testcxf.TestEndpointImpl"/>
>>>>>>                 <!--endpointName="s:TestEndpointPort"-->
>>>>>>                 <!--serviceName="s:TestEndpointService"-->
>>>>>>             <!--xmlns:s="http://test.transsys.ru" />-->
>>>>>>
>>>>>>
>>>>>>     <camel:camelContext
>>>>>> xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>>>> useJmx="false">
>>>>>>
>>>>>>         <route>
>>>>>>             <from ref="serviceEndpoint"/>
>>>>>>             <to id="aq1_In" uri="file:c:\temp\in"/>
>>>>>>         </route>
>>>>>>     </camel:camelContext>
>>>>>>
>>>>>>     <!-- implementation of the webservice -->
>>>>>>     <bean id="testEndpoint" class="ru.transsys.testcxf.TestEndpointImpl"/>
>>>>>>
>>>>>> </beans>
>>>>>>
>>>>>> what do you think about it ?
>>>>>>
>>>>>> thanks,
>>>>>> Evgeny
>>>>>>
>>>>
>>>
>>
>
>

Re: cxf spring configuration (camel 1.5.0)

Posted by William Tam <em...@gmail.com>.
BTW, Happy New Year!

On Sun, Jan 25, 2009 at 6:09 PM, William Tam <em...@gmail.com> wrote:
> On Sun, Jan 25, 2009 at 3:08 AM, Willem Jiang <wi...@gmail.com> wrote:
>> Hi William,
>>
>> Yes, I should set the beanId when I create the CxfSpringEndpont. I just
>> committed a quick fix for it.
>
> Thanks for fixing it.
>
>>
>> Let me explain it , Camel's converter has this kind of magic that will
>> turn a CxfSpringEndpointBean into a camel Endpoint, that's can make the
>> configuration more easier (don't need to specify the 'cxf:bean'), and
>
> I think it is a more personal taste thing.  I am not sure one is
> necessary better than the other.   IMHO, it is just yet another way of
> doing the same thing.
>
>> this magic can also help us to turn a Spring Integration Channel into a
>> Spring Integration Endpoint etc.
>>
>
> Since we can create CXF endpoint ref either way, the "magic" isn't an
> enabler for Spring Integration etc, right?
>
>> So the endpoint can be created by other not just by the component :)
>
> I guess my question was "should we".    It looks like null component
> is fine for CxfEndpoint..  Let's hope it won't come back to bite us.
> :-)
>
>>
>> Willem
>>
>>
>> William Tam wrote:
>>> Let me ask a dumb question.  What is the benefit of doing this?
>>> What's wrong with using "from" URI "cxf:bean:<beanId>" and let the
>>> CxfComponent construct the endpoint?  I thought endpoint was always
>>> created by a component(?)  Why we want to bypass all of that? Now, I
>>> think the CxfEndpoint may have a null component which could cause
>>> problem.  And, CxfSpringEndpoint may have empty beanId field which is
>>> used by the configure() method.
>>>
>>>
>>> On Sat, Jan 24, 2009 at 6:00 AM, Willem Jiang <wi...@gmail.com> wrote:
>>>> Since there are huge changes between the camel 2.0 and camel 1.6 in
>>>> camel-cxf module. I just commit a quick of CAMEL-1294 in Camel 2.0.
>>>>
>>>> Now you can define the rule like this in CAMEL 2.0-SNAPSHOT.
>>>> <camel:camelContext
>>>>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>>  useJmx="false">
>>>>          <route>
>>>>              <from uri="serviceEndpoint"/>
>>>>              <to id="aq1_In" uri="file:c:\temp\in"/>
>>>>          </route>
>>>>    </camel:camelContext>
>>>>
>>>> NOTE: we don't support use ref bean in the camel rule, since the auto
>>>> converting work can't be done in that case.
>>>>
>>>> Willem
>>>> Willem Jiang wrote:
>>>>> I just created a JIRA[1] for it, it should be fixed in the coming up
>>>>> CAMEL 1.6.
>>>>>
>>>>> [1]https://issues.apache.org/activemq/browse/CAMEL-1294
>>>>>
>>>>> Willem
>>>>>
>>>>> Willem Jiang wrote:
>>>>>> Hi,
>>>>>>
>>>>>> Current cxfEndpoint can't be directly used as a camel Endpoint.
>>>>>> You need to change your camel context
>>>>>>
>>>>>>  <camel:camelContext
>>>>>>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>>>>  useJmx="false">
>>>>>>
>>>>>>          <route>
>>>>>>              <from uri="cxf:bean:serviceEndpoint"/>
>>>>>>              <to id="aq1_In" uri="file:c:\temp\in"/>
>>>>>>          </route>
>>>>>>    </camel:camelContext>
>>>>>>
>>>>>> Willem
>>>>>>
>>>>>>
>>>>>> pevgen wrote:
>>>>>>> Hello.
>>>>>>>
>>>>>>> I try to configurate a cxf-endpoint in a spring config. But i got error
>>>>>>> "org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean
>>>>>>> named 'serviceEndpoint' must be of type [org.apache.camel.Endpoint], but was
>>>>>>> actually of type [org.apache.camel.component.cxf.spring.CxfEndpointBean]"
>>>>>>>
>>>>>>> config.xml :
>>>>>>>
>>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>> <beans xmlns="http://www.springframework.org/schema/beans"
>>>>>>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>>>        xmlns:jaxws="http://cxf.apache.org/jaxws"
>>>>>>>        xmlns:cxf="http://activemq.apache.org/camel/schema/cxfEndpoint"
>>>>>>>
>>>>>>>        xmlns:camel="http://activemq.apache.org/camel/schema/spring"
>>>>>>>        xsi:schemaLocation="http://www.springframework.org/schema/beans
>>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>>>>>>        http://activemq.apache.org/camel/schema/spring
>>>>>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
>>>>>>>        http://activemq.apache.org/camel/schema/cxfEndpoint
>>>>>>> http://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd
>>>>>>>        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
>>>>>>>
>>>>>>>     <import resource="classpath:META-INF/cxf/cxf.xml"/>
>>>>>>>     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
>>>>>>>     <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
>>>>>>>
>>>>>>>     <cxf:cxfEndpoint name="serviceEndpoint" id="serviceEndpoint"
>>>>>>> address="/incident"
>>>>>>>                 serviceClass="ru.transsys.testcxf.TestEndpointImpl"/>
>>>>>>>                 <!--endpointName="s:TestEndpointPort"-->
>>>>>>>                 <!--serviceName="s:TestEndpointService"-->
>>>>>>>             <!--xmlns:s="http://test.transsys.ru" />-->
>>>>>>>
>>>>>>>
>>>>>>>     <camel:camelContext
>>>>>>> xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>>>>> useJmx="false">
>>>>>>>
>>>>>>>         <route>
>>>>>>>             <from ref="serviceEndpoint"/>
>>>>>>>             <to id="aq1_In" uri="file:c:\temp\in"/>
>>>>>>>         </route>
>>>>>>>     </camel:camelContext>
>>>>>>>
>>>>>>>     <!-- implementation of the webservice -->
>>>>>>>     <bean id="testEndpoint" class="ru.transsys.testcxf.TestEndpointImpl"/>
>>>>>>>
>>>>>>> </beans>
>>>>>>>
>>>>>>> what do you think about it ?
>>>>>>>
>>>>>>> thanks,
>>>>>>> Evgeny
>>>>>>>
>>>>>
>>>>
>>>
>>
>>
>

Re: cxf spring configuration (camel 1.5.0)

Posted by William Tam <em...@gmail.com>.
On Sun, Jan 25, 2009 at 3:08 AM, Willem Jiang <wi...@gmail.com> wrote:
> Hi William,
>
> Yes, I should set the beanId when I create the CxfSpringEndpont. I just
> committed a quick fix for it.

Thanks for fixing it.

>
> Let me explain it , Camel's converter has this kind of magic that will
> turn a CxfSpringEndpointBean into a camel Endpoint, that's can make the
> configuration more easier (don't need to specify the 'cxf:bean'), and

I think it is a more personal taste thing.  I am not sure one is
necessary better than the other.   IMHO, it is just yet another way of
doing the same thing.

> this magic can also help us to turn a Spring Integration Channel into a
> Spring Integration Endpoint etc.
>

Since we can create CXF endpoint ref either way, the "magic" isn't an
enabler for Spring Integration etc, right?

> So the endpoint can be created by other not just by the component :)

I guess my question was "should we".    It looks like null component
is fine for CxfEndpoint..  Let's hope it won't come back to bite us.
:-)

>
> Willem
>
>
> William Tam wrote:
>> Let me ask a dumb question.  What is the benefit of doing this?
>> What's wrong with using "from" URI "cxf:bean:<beanId>" and let the
>> CxfComponent construct the endpoint?  I thought endpoint was always
>> created by a component(?)  Why we want to bypass all of that? Now, I
>> think the CxfEndpoint may have a null component which could cause
>> problem.  And, CxfSpringEndpoint may have empty beanId field which is
>> used by the configure() method.
>>
>>
>> On Sat, Jan 24, 2009 at 6:00 AM, Willem Jiang <wi...@gmail.com> wrote:
>>> Since there are huge changes between the camel 2.0 and camel 1.6 in
>>> camel-cxf module. I just commit a quick of CAMEL-1294 in Camel 2.0.
>>>
>>> Now you can define the rule like this in CAMEL 2.0-SNAPSHOT.
>>> <camel:camelContext
>>>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>  useJmx="false">
>>>          <route>
>>>              <from uri="serviceEndpoint"/>
>>>              <to id="aq1_In" uri="file:c:\temp\in"/>
>>>          </route>
>>>    </camel:camelContext>
>>>
>>> NOTE: we don't support use ref bean in the camel rule, since the auto
>>> converting work can't be done in that case.
>>>
>>> Willem
>>> Willem Jiang wrote:
>>>> I just created a JIRA[1] for it, it should be fixed in the coming up
>>>> CAMEL 1.6.
>>>>
>>>> [1]https://issues.apache.org/activemq/browse/CAMEL-1294
>>>>
>>>> Willem
>>>>
>>>> Willem Jiang wrote:
>>>>> Hi,
>>>>>
>>>>> Current cxfEndpoint can't be directly used as a camel Endpoint.
>>>>> You need to change your camel context
>>>>>
>>>>>  <camel:camelContext
>>>>>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>>>  useJmx="false">
>>>>>
>>>>>          <route>
>>>>>              <from uri="cxf:bean:serviceEndpoint"/>
>>>>>              <to id="aq1_In" uri="file:c:\temp\in"/>
>>>>>          </route>
>>>>>    </camel:camelContext>
>>>>>
>>>>> Willem
>>>>>
>>>>>
>>>>> pevgen wrote:
>>>>>> Hello.
>>>>>>
>>>>>> I try to configurate a cxf-endpoint in a spring config. But i got error
>>>>>> "org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean
>>>>>> named 'serviceEndpoint' must be of type [org.apache.camel.Endpoint], but was
>>>>>> actually of type [org.apache.camel.component.cxf.spring.CxfEndpointBean]"
>>>>>>
>>>>>> config.xml :
>>>>>>
>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>> <beans xmlns="http://www.springframework.org/schema/beans"
>>>>>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>>        xmlns:jaxws="http://cxf.apache.org/jaxws"
>>>>>>        xmlns:cxf="http://activemq.apache.org/camel/schema/cxfEndpoint"
>>>>>>
>>>>>>        xmlns:camel="http://activemq.apache.org/camel/schema/spring"
>>>>>>        xsi:schemaLocation="http://www.springframework.org/schema/beans
>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>>>>>        http://activemq.apache.org/camel/schema/spring
>>>>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
>>>>>>        http://activemq.apache.org/camel/schema/cxfEndpoint
>>>>>> http://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd
>>>>>>        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
>>>>>>
>>>>>>     <import resource="classpath:META-INF/cxf/cxf.xml"/>
>>>>>>     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
>>>>>>     <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
>>>>>>
>>>>>>     <cxf:cxfEndpoint name="serviceEndpoint" id="serviceEndpoint"
>>>>>> address="/incident"
>>>>>>                 serviceClass="ru.transsys.testcxf.TestEndpointImpl"/>
>>>>>>                 <!--endpointName="s:TestEndpointPort"-->
>>>>>>                 <!--serviceName="s:TestEndpointService"-->
>>>>>>             <!--xmlns:s="http://test.transsys.ru" />-->
>>>>>>
>>>>>>
>>>>>>     <camel:camelContext
>>>>>> xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>>>> useJmx="false">
>>>>>>
>>>>>>         <route>
>>>>>>             <from ref="serviceEndpoint"/>
>>>>>>             <to id="aq1_In" uri="file:c:\temp\in"/>
>>>>>>         </route>
>>>>>>     </camel:camelContext>
>>>>>>
>>>>>>     <!-- implementation of the webservice -->
>>>>>>     <bean id="testEndpoint" class="ru.transsys.testcxf.TestEndpointImpl"/>
>>>>>>
>>>>>> </beans>
>>>>>>
>>>>>> what do you think about it ?
>>>>>>
>>>>>> thanks,
>>>>>> Evgeny
>>>>>>
>>>>
>>>
>>
>
>

Re: cxf spring configuration (camel 1.5.0)

Posted by Willem Jiang <wi...@gmail.com>.
Hi William,

Yes, I should set the beanId when I create the CxfSpringEndpont. I just
committed a quick fix for it.

Let me explain it , Camel's converter has this kind of magic that will
turn a CxfSpringEndpointBean into a camel Endpoint, that's can make the
configuration more easier (don't need to specify the 'cxf:bean'), and
this magic can also help us to turn a Spring Integration Channel into a
Spring Integration Endpoint etc.

So the endpoint can be created by other not just by the component :)

Willem


William Tam wrote:
> Let me ask a dumb question.  What is the benefit of doing this?
> What's wrong with using "from" URI "cxf:bean:<beanId>" and let the
> CxfComponent construct the endpoint?  I thought endpoint was always
> created by a component(?)  Why we want to bypass all of that? Now, I
> think the CxfEndpoint may have a null component which could cause
> problem.  And, CxfSpringEndpoint may have empty beanId field which is
> used by the configure() method.
> 
> 
> On Sat, Jan 24, 2009 at 6:00 AM, Willem Jiang <wi...@gmail.com> wrote:
>> Since there are huge changes between the camel 2.0 and camel 1.6 in
>> camel-cxf module. I just commit a quick of CAMEL-1294 in Camel 2.0.
>>
>> Now you can define the rule like this in CAMEL 2.0-SNAPSHOT.
>> <camel:camelContext
>>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>  useJmx="false">
>>          <route>
>>              <from uri="serviceEndpoint"/>
>>              <to id="aq1_In" uri="file:c:\temp\in"/>
>>          </route>
>>    </camel:camelContext>
>>
>> NOTE: we don't support use ref bean in the camel rule, since the auto
>> converting work can't be done in that case.
>>
>> Willem
>> Willem Jiang wrote:
>>> I just created a JIRA[1] for it, it should be fixed in the coming up
>>> CAMEL 1.6.
>>>
>>> [1]https://issues.apache.org/activemq/browse/CAMEL-1294
>>>
>>> Willem
>>>
>>> Willem Jiang wrote:
>>>> Hi,
>>>>
>>>> Current cxfEndpoint can't be directly used as a camel Endpoint.
>>>> You need to change your camel context
>>>>
>>>>  <camel:camelContext
>>>>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>>  useJmx="false">
>>>>
>>>>          <route>
>>>>              <from uri="cxf:bean:serviceEndpoint"/>
>>>>              <to id="aq1_In" uri="file:c:\temp\in"/>
>>>>          </route>
>>>>    </camel:camelContext>
>>>>
>>>> Willem
>>>>
>>>>
>>>> pevgen wrote:
>>>>> Hello.
>>>>>
>>>>> I try to configurate a cxf-endpoint in a spring config. But i got error
>>>>> "org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean
>>>>> named 'serviceEndpoint' must be of type [org.apache.camel.Endpoint], but was
>>>>> actually of type [org.apache.camel.component.cxf.spring.CxfEndpointBean]"
>>>>>
>>>>> config.xml :
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>> <beans xmlns="http://www.springframework.org/schema/beans"
>>>>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>        xmlns:jaxws="http://cxf.apache.org/jaxws"
>>>>>        xmlns:cxf="http://activemq.apache.org/camel/schema/cxfEndpoint"
>>>>>
>>>>>        xmlns:camel="http://activemq.apache.org/camel/schema/spring"
>>>>>        xsi:schemaLocation="http://www.springframework.org/schema/beans
>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>>>>        http://activemq.apache.org/camel/schema/spring
>>>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
>>>>>        http://activemq.apache.org/camel/schema/cxfEndpoint
>>>>> http://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd
>>>>>        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
>>>>>
>>>>>     <import resource="classpath:META-INF/cxf/cxf.xml"/>
>>>>>     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
>>>>>     <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
>>>>>
>>>>>     <cxf:cxfEndpoint name="serviceEndpoint" id="serviceEndpoint"
>>>>> address="/incident"
>>>>>                 serviceClass="ru.transsys.testcxf.TestEndpointImpl"/>
>>>>>                 <!--endpointName="s:TestEndpointPort"-->
>>>>>                 <!--serviceName="s:TestEndpointService"-->
>>>>>             <!--xmlns:s="http://test.transsys.ru" />-->
>>>>>
>>>>>
>>>>>     <camel:camelContext
>>>>> xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>>> useJmx="false">
>>>>>
>>>>>         <route>
>>>>>             <from ref="serviceEndpoint"/>
>>>>>             <to id="aq1_In" uri="file:c:\temp\in"/>
>>>>>         </route>
>>>>>     </camel:camelContext>
>>>>>
>>>>>     <!-- implementation of the webservice -->
>>>>>     <bean id="testEndpoint" class="ru.transsys.testcxf.TestEndpointImpl"/>
>>>>>
>>>>> </beans>
>>>>>
>>>>> what do you think about it ?
>>>>>
>>>>> thanks,
>>>>> Evgeny
>>>>>
>>>
>>
> 


Re: cxf spring configuration (camel 1.5.0)

Posted by William Tam <em...@gmail.com>.
So, in Evgeny's example, I believe this should work without requiring any fixes.

 <cxf:cxfEndpoint id="cxfEndpointConfig"
        address="/incident"
        serviceClass="ru.transsys.testcxf.TestEndpointImpl"/>

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

       <!--- put this endpoint in registry -->
       <endpoint id="serviceEndpoint" uri="cxf:bean:cxfEndpointConfig"/>

       <route>
           <from ref="serviceEndpoint"/>
           <to id="aq1_In" uri="file:c:\temp\in"/>
       </route>
</camel:camelContext>

I guess one reason to use "ref" could be reusing an endpoint
definition in more than one route.  This should achieve it.


On Sat, Jan 24, 2009 at 11:15 AM, William Tam <em...@gmail.com> wrote:
> In the "Ref" wiki page (http://camel.apache.org/ref.html), a sample
> usage suggests that endpoint bean is created from URI with component
> scheme.  Perhaps, we should support this pattern instead?
>
> <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
>  <endpoint id="endpoint1" uri="direct:start"/>
>  <endpoint id="endpoint2" uri="mock:end"/>
>
>  <route>
>    <from ref="endpoint1"/>
>    <to uri="ref:endpoint2"/>
>  </route>
> </camelContext>
>
> On Sat, Jan 24, 2009 at 10:45 AM, William Tam <em...@gmail.com> wrote:
>> Let me ask a dumb question.  What is the benefit of doing this?
>> What's wrong with using "from" URI "cxf:bean:<beanId>" and let the
>> CxfComponent construct the endpoint?  I thought endpoint was always
>> created by a component(?)  Why we want to bypass all of that? Now, I
>> think the CxfEndpoint may have a null component which could cause
>> problem.  And, CxfSpringEndpoint may have empty beanId field which is
>> used by the configure() method.
>>
>>
>> On Sat, Jan 24, 2009 at 6:00 AM, Willem Jiang <wi...@gmail.com> wrote:
>>> Since there are huge changes between the camel 2.0 and camel 1.6 in
>>> camel-cxf module. I just commit a quick of CAMEL-1294 in Camel 2.0.
>>>
>>> Now you can define the rule like this in CAMEL 2.0-SNAPSHOT.
>>> <camel:camelContext
>>>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>  useJmx="false">
>>>          <route>
>>>              <from uri="serviceEndpoint"/>
>>>              <to id="aq1_In" uri="file:c:\temp\in"/>
>>>          </route>
>>>    </camel:camelContext>
>>>
>>> NOTE: we don't support use ref bean in the camel rule, since the auto
>>> converting work can't be done in that case.
>>>
>>> Willem
>>> Willem Jiang wrote:
>>>> I just created a JIRA[1] for it, it should be fixed in the coming up
>>>> CAMEL 1.6.
>>>>
>>>> [1]https://issues.apache.org/activemq/browse/CAMEL-1294
>>>>
>>>> Willem
>>>>
>>>> Willem Jiang wrote:
>>>>> Hi,
>>>>>
>>>>> Current cxfEndpoint can't be directly used as a camel Endpoint.
>>>>> You need to change your camel context
>>>>>
>>>>>  <camel:camelContext
>>>>>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>>>  useJmx="false">
>>>>>
>>>>>          <route>
>>>>>              <from uri="cxf:bean:serviceEndpoint"/>
>>>>>              <to id="aq1_In" uri="file:c:\temp\in"/>
>>>>>          </route>
>>>>>    </camel:camelContext>
>>>>>
>>>>> Willem
>>>>>
>>>>>
>>>>> pevgen wrote:
>>>>>> Hello.
>>>>>>
>>>>>> I try to configurate a cxf-endpoint in a spring config. But i got error
>>>>>> "org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean
>>>>>> named 'serviceEndpoint' must be of type [org.apache.camel.Endpoint], but was
>>>>>> actually of type [org.apache.camel.component.cxf.spring.CxfEndpointBean]"
>>>>>>
>>>>>> config.xml :
>>>>>>
>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>> <beans xmlns="http://www.springframework.org/schema/beans"
>>>>>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>>        xmlns:jaxws="http://cxf.apache.org/jaxws"
>>>>>>        xmlns:cxf="http://activemq.apache.org/camel/schema/cxfEndpoint"
>>>>>>
>>>>>>        xmlns:camel="http://activemq.apache.org/camel/schema/spring"
>>>>>>        xsi:schemaLocation="http://www.springframework.org/schema/beans
>>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>>>>>        http://activemq.apache.org/camel/schema/spring
>>>>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
>>>>>>        http://activemq.apache.org/camel/schema/cxfEndpoint
>>>>>> http://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd
>>>>>>        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
>>>>>>
>>>>>>     <import resource="classpath:META-INF/cxf/cxf.xml"/>
>>>>>>     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
>>>>>>     <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
>>>>>>
>>>>>>     <cxf:cxfEndpoint name="serviceEndpoint" id="serviceEndpoint"
>>>>>> address="/incident"
>>>>>>                 serviceClass="ru.transsys.testcxf.TestEndpointImpl"/>
>>>>>>                 <!--endpointName="s:TestEndpointPort"-->
>>>>>>                 <!--serviceName="s:TestEndpointService"-->
>>>>>>             <!--xmlns:s="http://test.transsys.ru" />-->
>>>>>>
>>>>>>
>>>>>>     <camel:camelContext
>>>>>> xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>>>> useJmx="false">
>>>>>>
>>>>>>         <route>
>>>>>>             <from ref="serviceEndpoint"/>
>>>>>>             <to id="aq1_In" uri="file:c:\temp\in"/>
>>>>>>         </route>
>>>>>>     </camel:camelContext>
>>>>>>
>>>>>>     <!-- implementation of the webservice -->
>>>>>>     <bean id="testEndpoint" class="ru.transsys.testcxf.TestEndpointImpl"/>
>>>>>>
>>>>>> </beans>
>>>>>>
>>>>>> what do you think about it ?
>>>>>>
>>>>>> thanks,
>>>>>> Evgeny
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>

Re: cxf spring configuration (camel 1.5.0)

Posted by William Tam <em...@gmail.com>.
In the "Ref" wiki page (http://camel.apache.org/ref.html), a sample
usage suggests that endpoint bean is created from URI with component
scheme.  Perhaps, we should support this pattern instead?

<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
  <endpoint id="endpoint1" uri="direct:start"/>
  <endpoint id="endpoint2" uri="mock:end"/>

  <route>
    <from ref="endpoint1"/>
    <to uri="ref:endpoint2"/>
  </route>
</camelContext>

On Sat, Jan 24, 2009 at 10:45 AM, William Tam <em...@gmail.com> wrote:
> Let me ask a dumb question.  What is the benefit of doing this?
> What's wrong with using "from" URI "cxf:bean:<beanId>" and let the
> CxfComponent construct the endpoint?  I thought endpoint was always
> created by a component(?)  Why we want to bypass all of that? Now, I
> think the CxfEndpoint may have a null component which could cause
> problem.  And, CxfSpringEndpoint may have empty beanId field which is
> used by the configure() method.
>
>
> On Sat, Jan 24, 2009 at 6:00 AM, Willem Jiang <wi...@gmail.com> wrote:
>> Since there are huge changes between the camel 2.0 and camel 1.6 in
>> camel-cxf module. I just commit a quick of CAMEL-1294 in Camel 2.0.
>>
>> Now you can define the rule like this in CAMEL 2.0-SNAPSHOT.
>> <camel:camelContext
>>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>  useJmx="false">
>>          <route>
>>              <from uri="serviceEndpoint"/>
>>              <to id="aq1_In" uri="file:c:\temp\in"/>
>>          </route>
>>    </camel:camelContext>
>>
>> NOTE: we don't support use ref bean in the camel rule, since the auto
>> converting work can't be done in that case.
>>
>> Willem
>> Willem Jiang wrote:
>>> I just created a JIRA[1] for it, it should be fixed in the coming up
>>> CAMEL 1.6.
>>>
>>> [1]https://issues.apache.org/activemq/browse/CAMEL-1294
>>>
>>> Willem
>>>
>>> Willem Jiang wrote:
>>>> Hi,
>>>>
>>>> Current cxfEndpoint can't be directly used as a camel Endpoint.
>>>> You need to change your camel context
>>>>
>>>>  <camel:camelContext
>>>>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>>  useJmx="false">
>>>>
>>>>          <route>
>>>>              <from uri="cxf:bean:serviceEndpoint"/>
>>>>              <to id="aq1_In" uri="file:c:\temp\in"/>
>>>>          </route>
>>>>    </camel:camelContext>
>>>>
>>>> Willem
>>>>
>>>>
>>>> pevgen wrote:
>>>>> Hello.
>>>>>
>>>>> I try to configurate a cxf-endpoint in a spring config. But i got error
>>>>> "org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean
>>>>> named 'serviceEndpoint' must be of type [org.apache.camel.Endpoint], but was
>>>>> actually of type [org.apache.camel.component.cxf.spring.CxfEndpointBean]"
>>>>>
>>>>> config.xml :
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>> <beans xmlns="http://www.springframework.org/schema/beans"
>>>>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>        xmlns:jaxws="http://cxf.apache.org/jaxws"
>>>>>        xmlns:cxf="http://activemq.apache.org/camel/schema/cxfEndpoint"
>>>>>
>>>>>        xmlns:camel="http://activemq.apache.org/camel/schema/spring"
>>>>>        xsi:schemaLocation="http://www.springframework.org/schema/beans
>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>>>>        http://activemq.apache.org/camel/schema/spring
>>>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
>>>>>        http://activemq.apache.org/camel/schema/cxfEndpoint
>>>>> http://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd
>>>>>        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
>>>>>
>>>>>     <import resource="classpath:META-INF/cxf/cxf.xml"/>
>>>>>     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
>>>>>     <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
>>>>>
>>>>>     <cxf:cxfEndpoint name="serviceEndpoint" id="serviceEndpoint"
>>>>> address="/incident"
>>>>>                 serviceClass="ru.transsys.testcxf.TestEndpointImpl"/>
>>>>>                 <!--endpointName="s:TestEndpointPort"-->
>>>>>                 <!--serviceName="s:TestEndpointService"-->
>>>>>             <!--xmlns:s="http://test.transsys.ru" />-->
>>>>>
>>>>>
>>>>>     <camel:camelContext
>>>>> xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>>> useJmx="false">
>>>>>
>>>>>         <route>
>>>>>             <from ref="serviceEndpoint"/>
>>>>>             <to id="aq1_In" uri="file:c:\temp\in"/>
>>>>>         </route>
>>>>>     </camel:camelContext>
>>>>>
>>>>>     <!-- implementation of the webservice -->
>>>>>     <bean id="testEndpoint" class="ru.transsys.testcxf.TestEndpointImpl"/>
>>>>>
>>>>> </beans>
>>>>>
>>>>> what do you think about it ?
>>>>>
>>>>> thanks,
>>>>> Evgeny
>>>>>
>>>>
>>>
>>>
>>
>>
>

Re: cxf spring configuration (camel 1.5.0)

Posted by William Tam <em...@gmail.com>.
Let me ask a dumb question.  What is the benefit of doing this?
What's wrong with using "from" URI "cxf:bean:<beanId>" and let the
CxfComponent construct the endpoint?  I thought endpoint was always
created by a component(?)  Why we want to bypass all of that? Now, I
think the CxfEndpoint may have a null component which could cause
problem.  And, CxfSpringEndpoint may have empty beanId field which is
used by the configure() method.


On Sat, Jan 24, 2009 at 6:00 AM, Willem Jiang <wi...@gmail.com> wrote:
> Since there are huge changes between the camel 2.0 and camel 1.6 in
> camel-cxf module. I just commit a quick of CAMEL-1294 in Camel 2.0.
>
> Now you can define the rule like this in CAMEL 2.0-SNAPSHOT.
> <camel:camelContext
>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>  useJmx="false">
>          <route>
>              <from uri="serviceEndpoint"/>
>              <to id="aq1_In" uri="file:c:\temp\in"/>
>          </route>
>    </camel:camelContext>
>
> NOTE: we don't support use ref bean in the camel rule, since the auto
> converting work can't be done in that case.
>
> Willem
> Willem Jiang wrote:
>> I just created a JIRA[1] for it, it should be fixed in the coming up
>> CAMEL 1.6.
>>
>> [1]https://issues.apache.org/activemq/browse/CAMEL-1294
>>
>> Willem
>>
>> Willem Jiang wrote:
>>> Hi,
>>>
>>> Current cxfEndpoint can't be directly used as a camel Endpoint.
>>> You need to change your camel context
>>>
>>>  <camel:camelContext
>>>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>  useJmx="false">
>>>
>>>          <route>
>>>              <from uri="cxf:bean:serviceEndpoint"/>
>>>              <to id="aq1_In" uri="file:c:\temp\in"/>
>>>          </route>
>>>    </camel:camelContext>
>>>
>>> Willem
>>>
>>>
>>> pevgen wrote:
>>>> Hello.
>>>>
>>>> I try to configurate a cxf-endpoint in a spring config. But i got error
>>>> "org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean
>>>> named 'serviceEndpoint' must be of type [org.apache.camel.Endpoint], but was
>>>> actually of type [org.apache.camel.component.cxf.spring.CxfEndpointBean]"
>>>>
>>>> config.xml :
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <beans xmlns="http://www.springframework.org/schema/beans"
>>>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>        xmlns:jaxws="http://cxf.apache.org/jaxws"
>>>>        xmlns:cxf="http://activemq.apache.org/camel/schema/cxfEndpoint"
>>>>
>>>>        xmlns:camel="http://activemq.apache.org/camel/schema/spring"
>>>>        xsi:schemaLocation="http://www.springframework.org/schema/beans
>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>>>        http://activemq.apache.org/camel/schema/spring
>>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
>>>>        http://activemq.apache.org/camel/schema/cxfEndpoint
>>>> http://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd
>>>>        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
>>>>
>>>>     <import resource="classpath:META-INF/cxf/cxf.xml"/>
>>>>     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
>>>>     <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
>>>>
>>>>     <cxf:cxfEndpoint name="serviceEndpoint" id="serviceEndpoint"
>>>> address="/incident"
>>>>                 serviceClass="ru.transsys.testcxf.TestEndpointImpl"/>
>>>>                 <!--endpointName="s:TestEndpointPort"-->
>>>>                 <!--serviceName="s:TestEndpointService"-->
>>>>             <!--xmlns:s="http://test.transsys.ru" />-->
>>>>
>>>>
>>>>     <camel:camelContext
>>>> xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>>> useJmx="false">
>>>>
>>>>         <route>
>>>>             <from ref="serviceEndpoint"/>
>>>>             <to id="aq1_In" uri="file:c:\temp\in"/>
>>>>         </route>
>>>>     </camel:camelContext>
>>>>
>>>>     <!-- implementation of the webservice -->
>>>>     <bean id="testEndpoint" class="ru.transsys.testcxf.TestEndpointImpl"/>
>>>>
>>>> </beans>
>>>>
>>>> what do you think about it ?
>>>>
>>>> thanks,
>>>> Evgeny
>>>>
>>>
>>
>>
>
>

Re: cxf spring configuration (camel 1.5.0)

Posted by Willem Jiang <wi...@gmail.com>.
Since there are huge changes between the camel 2.0 and camel 1.6 in
camel-cxf module. I just commit a quick of CAMEL-1294 in Camel 2.0.

Now you can define the rule like this in CAMEL 2.0-SNAPSHOT.
<camel:camelContext
  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
  useJmx="false">
          <route>
              <from uri="serviceEndpoint"/>
              <to id="aq1_In" uri="file:c:\temp\in"/>
          </route>
    </camel:camelContext>

NOTE: we don't support use ref bean in the camel rule, since the auto
converting work can't be done in that case.

Willem
Willem Jiang wrote:
> I just created a JIRA[1] for it, it should be fixed in the coming up
> CAMEL 1.6.
> 
> [1]https://issues.apache.org/activemq/browse/CAMEL-1294
> 
> Willem
> 
> Willem Jiang wrote:
>> Hi,
>>
>> Current cxfEndpoint can't be directly used as a camel Endpoint.
>> You need to change your camel context
>>
>>  <camel:camelContext
>>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>  useJmx="false">
>>
>>          <route>
>>              <from uri="cxf:bean:serviceEndpoint"/>
>>              <to id="aq1_In" uri="file:c:\temp\in"/>
>>          </route>
>>    </camel:camelContext>
>>
>> Willem
>>
>>
>> pevgen wrote:
>>> Hello.
>>>
>>> I try to configurate a cxf-endpoint in a spring config. But i got error 
>>> "org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean
>>> named 'serviceEndpoint' must be of type [org.apache.camel.Endpoint], but was
>>> actually of type [org.apache.camel.component.cxf.spring.CxfEndpointBean]"
>>>
>>> config.xml :
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <beans xmlns="http://www.springframework.org/schema/beans"
>>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>        xmlns:jaxws="http://cxf.apache.org/jaxws"
>>>        xmlns:cxf="http://activemq.apache.org/camel/schema/cxfEndpoint"
>>>         
>>>        xmlns:camel="http://activemq.apache.org/camel/schema/spring"
>>>        xsi:schemaLocation="http://www.springframework.org/schema/beans
>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>>        http://activemq.apache.org/camel/schema/spring
>>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
>>>        http://activemq.apache.org/camel/schema/cxfEndpoint
>>> http://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd
>>>        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
>>>
>>>     <import resource="classpath:META-INF/cxf/cxf.xml"/>
>>>     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
>>>     <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
>>>
>>>     <cxf:cxfEndpoint name="serviceEndpoint" id="serviceEndpoint"
>>> address="/incident"
>>>                 serviceClass="ru.transsys.testcxf.TestEndpointImpl"/>
>>>                 <!--endpointName="s:TestEndpointPort"-->
>>>                 <!--serviceName="s:TestEndpointService"-->
>>>             <!--xmlns:s="http://test.transsys.ru" />-->
>>>     
>>>
>>>     <camel:camelContext
>>> xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>>> useJmx="false">
>>>
>>>         <route>
>>>             <from ref="serviceEndpoint"/>
>>>             <to id="aq1_In" uri="file:c:\temp\in"/>
>>>         </route>
>>>     </camel:camelContext>
>>>
>>>     <!-- implementation of the webservice -->
>>>     <bean id="testEndpoint" class="ru.transsys.testcxf.TestEndpointImpl"/>
>>>
>>> </beans>
>>>
>>> what do you think about it ?
>>>
>>> thanks,
>>> Evgeny
>>>
>>
> 
> 


Re: cxf spring configuration (camel 1.5.0)

Posted by Willem Jiang <wi...@gmail.com>.
I just created a JIRA[1] for it, it should be fixed in the coming up
CAMEL 1.6.

[1]https://issues.apache.org/activemq/browse/CAMEL-1294

Willem

Willem Jiang wrote:
> Hi,
> 
> Current cxfEndpoint can't be directly used as a camel Endpoint.
> You need to change your camel context
> 
>  <camel:camelContext
>  xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>  useJmx="false">
> 
>          <route>
>              <from uri="cxf:bean:serviceEndpoint"/>
>              <to id="aq1_In" uri="file:c:\temp\in"/>
>          </route>
>    </camel:camelContext>
> 
> Willem
> 
> 
> pevgen wrote:
>> Hello.
>>
>> I try to configurate a cxf-endpoint in a spring config. But i got error 
>> "org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean
>> named 'serviceEndpoint' must be of type [org.apache.camel.Endpoint], but was
>> actually of type [org.apache.camel.component.cxf.spring.CxfEndpointBean]"
>>
>> config.xml :
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>        xmlns:jaxws="http://cxf.apache.org/jaxws"
>>        xmlns:cxf="http://activemq.apache.org/camel/schema/cxfEndpoint"
>>         
>>        xmlns:camel="http://activemq.apache.org/camel/schema/spring"
>>        xsi:schemaLocation="http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>        http://activemq.apache.org/camel/schema/spring
>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
>>        http://activemq.apache.org/camel/schema/cxfEndpoint
>> http://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd
>>        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
>>
>>     <import resource="classpath:META-INF/cxf/cxf.xml"/>
>>     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
>>     <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
>>
>>     <cxf:cxfEndpoint name="serviceEndpoint" id="serviceEndpoint"
>> address="/incident"
>>                 serviceClass="ru.transsys.testcxf.TestEndpointImpl"/>
>>                 <!--endpointName="s:TestEndpointPort"-->
>>                 <!--serviceName="s:TestEndpointService"-->
>>             <!--xmlns:s="http://test.transsys.ru" />-->
>>     
>>
>>     <camel:camelContext
>> xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
>> useJmx="false">
>>
>>         <route>
>>             <from ref="serviceEndpoint"/>
>>             <to id="aq1_In" uri="file:c:\temp\in"/>
>>         </route>
>>     </camel:camelContext>
>>
>>     <!-- implementation of the webservice -->
>>     <bean id="testEndpoint" class="ru.transsys.testcxf.TestEndpointImpl"/>
>>
>> </beans>
>>
>> what do you think about it ?
>>
>> thanks,
>> Evgeny
>>
> 
> 


Re: cxf spring configuration (camel 1.5.0)

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

Current cxfEndpoint can't be directly used as a camel Endpoint.
You need to change your camel context

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

         <route>
             <from uri="cxf:bean:serviceEndpoint"/>
             <to id="aq1_In" uri="file:c:\temp\in"/>
         </route>
   </camel:camelContext>

Willem


pevgen wrote:
> Hello.
> 
> I try to configurate a cxf-endpoint in a spring config. But i got error 
> "org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean
> named 'serviceEndpoint' must be of type [org.apache.camel.Endpoint], but was
> actually of type [org.apache.camel.component.cxf.spring.CxfEndpointBean]"
> 
> config.xml :
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xmlns:jaxws="http://cxf.apache.org/jaxws"
>        xmlns:cxf="http://activemq.apache.org/camel/schema/cxfEndpoint"
>         
>        xmlns:camel="http://activemq.apache.org/camel/schema/spring"
>        xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>        http://activemq.apache.org/camel/schema/spring
> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
>        http://activemq.apache.org/camel/schema/cxfEndpoint
> http://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd
>        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
> 
>     <import resource="classpath:META-INF/cxf/cxf.xml"/>
>     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
>     <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
> 
>     <cxf:cxfEndpoint name="serviceEndpoint" id="serviceEndpoint"
> address="/incident"
>                 serviceClass="ru.transsys.testcxf.TestEndpointImpl"/>
>                 <!--endpointName="s:TestEndpointPort"-->
>                 <!--serviceName="s:TestEndpointService"-->
>             <!--xmlns:s="http://test.transsys.ru" />-->
>     
> 
>     <camel:camelContext
> xmlns="http://activemq.apache.org/camel/schema/spring" id="camel"
> useJmx="false">
> 
>         <route>
>             <from ref="serviceEndpoint"/>
>             <to id="aq1_In" uri="file:c:\temp\in"/>
>         </route>
>     </camel:camelContext>
> 
>     <!-- implementation of the webservice -->
>     <bean id="testEndpoint" class="ru.transsys.testcxf.TestEndpointImpl"/>
> 
> </beans>
> 
> what do you think about it ?
> 
> thanks,
> Evgeny
>