camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Tam <email.w...@gmail.com>
Subject Re: Passing some properties from Camel to CXF
Date Thu, 23 Dec 2010 16:11:49 GMT
On CXF side, you can access headers like this:

import org.apache.cxf.message.Message;

Message cxfMessage;

Map<String, List<String>> cxfHeaders = 
(Map)cxfMessage.get(Message.PROTOCOL_HEADERS);
List<String> values = cxfHeaders.get("myheader");


On 12/23/2010 09:54 AM, Aki Yoshida wrote:
> Hi,
> I am trying to pass the Camel headers to the CXF component, but
> somehow I am having trouble. For example, when I use the following
> configuration:
>
>        <camel:from uri="file:..."/>
>        <camel:setHeader headerName="myheader">
>            <camel:constant>myvalue</camel:constant>
>        </camel:setHeader>	
>        <camel:to uri="cxf:bean:..." />
>
> I thought this header would be placed somewhere in the CXF message so
> that I could access it from CXF.
> But somehow I couldn't find it in the CXF message.
>
> To find out where it is placed, I went through CxfProducer. The header
> value is visible in the Camel's inbound message's header. But somehow
> I found only the code that reads the operation name form the camel
> message's header but didn't find the part that copies the rest of the
> camel message's headers into somewhere in the CXF message or exchange.
>
> Could someone tell me where I can find the headers?
>
> Thanks.
> Regards, Aki
>

Mime
View raw message