[ 
https://issues.apache.org/activemq/browse/CAMEL-1487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=50874#action_50874
 ] 

Willem Jiang commented on CAMEL-1487:
-------------------------------------

I managed to redeploy the camel-cxf endpoint in osgi by using the cxf-osgi 
transport.
Here is the configuration file which base on the camel-1.x , you may need to 
change it for using camel2.0
{code}
<?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:camel="http://activemq.apache.org/camel/schema/spring";
        xmlns:osgi="http://www.springframework.org/schema/osgi";
        xmlns:cxf="http://activemq.apache.org/camel/schema/cxfEndpoint";
        xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/osgi
        http://www.springframework.org/schema/osgi/spring-osgi.xsd
        http://activemq.apache.org/camel/schema/osgi
        http://activemq.apache.org/camel/schema/osgi/camel-osgi-1.6.0.xsd       
        
        http://activemq.apache.org/camel/schema/spring
        http://activemq.apache.org/camel/schema/spring/camel-spring-1.6.0.xsd
        http://activemq.apache.org/camel/schema/cxfEndpoint 
http://activemq.apache.org/camel/schema/cxf/camel-cxf-1.6.0.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-extension-http.xml" />
 <import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />  
 
        <bean id="myBean" 
class="org.apache.camel.example.reportincident.internal.MyBean" />
        
        <!-- webservice endpoint --> 
        <cxf:cxfEndpoint id="reportIncident"
                address="/example/incident"
                
serviceClass="org.apache.camel.example.reportincident.ReportIncidentEndpoint"
                xmlns:s="http://reportincident.example.camel.apache.org";>
        </cxf:cxfEndpoint>
        
        <camelContext trace="true" 
xmlns="http://activemq.apache.org/camel/schema/osgi";>

                <!-- Receive WS message -->
                <camel:route>
                        <camel:from uri="cxf:bean:reportIncident" />
                        <!-- issue resolved 26/03/2009 -->
                        <camel:setHeader headerName="origin">
                                <camel:constant>webservice</camel:constant>
                        </camel:setHeader>
                        <camel:convertBodyTo 
type="org.apache.camel.example.reportincident.InputReportIncident" />
                        <camel:to uri="bean:myBean" />
                        <!--camel:transform>
                                <camel:method bean="feedback" method="setOk" />
                        </camel:transform-->
                </camel:route>

        </camelContext>
</beans>
{code}

> camel-cxf endpoint does not support setHeader when the camel routes are 
> deployed in SMX kernel / after a change in the camel-context servicemix must 
> be restrated
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1487
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1487
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>         Environment: SMX Kernel 1.2-SNAPSHOT, Camel 2.0-SNAPSHOT, CXF 
> 2.2-SNAPSHOT
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>
> Hi,
> A) Set Header not supported
> The following camel spring DSL syntax deployed in a OSGI bundle (ServiceMix 
> Kernel 1.2-SNAPSHOT) does not allow to the webservice to work :
> {code}
>               <!-- CXF route -->
>               <camel:route>
>                       <camel:from uri="cxf:bean:reportIncident" />
>                       <camel:setHeader headerName="origin">
>                               <camel:constant>webservice</camel:constant>
>                       </camel:setHeader>
>                       <camel:convertBodyTo 
> type="org.apache.camel.example.reportincident.InputReportIncident" />
> ....
> {code}
> Apparently adding a setHeader is not accepted by camel:cxf endpoint :-(
> B) Server must be restarted
> When I remove the setHeader from the camel route :
> {code}
>               <!-- CXF route -->
>               <camel:route>
>                       <camel:from uri="cxf:bean:reportIncident" />
>                       <camel:convertBodyTo 
> type="org.apache.camel.example.reportincident.InputReportIncident" />
> ....
> {code}
> and that I update the bundle, I must restart the ServiceMix Server in order 
> to have a webService operational !!!!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to