servicemix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "przemyslaw.gruzdz" <>
Subject How to set custom soap header information (in custom naspace) in camel route (using spring configuration)?
Date Wed, 18 Apr 2012 05:49:27 GMT
Hello everyone,

After few days of struggle a I decided to ask for clue/advice.. I have read
a lot of messages but I still can’t find relevant answer.

So here is the background:

I have configured Camel Proxy/router service with spring xml file.

cxfEndpoint -> hedader based routing -> body xslt transformation ->
cxfEndpoint (backend service)

This solution worked great until it turned out, that I have to set few
custom attributes in custom namepace In SOAP header of message forwarded to
backend service.

And here comes my question:

*How to set custom soap header information (in custom naspace) in camel
route (using spring configuration)?* For example, I want to add such header
forwarded to backend service by my camel route:

<soapenv:Envelope xmlns:soapenv=>
<CustomUsernameToken xmlns="">custom_value</
<CustomPasswordText xmlns="">custom_value</

Here are snippets with my current configuration

Exposed endpoint:
<cxf:cxfEndpoint id="crmServices" address=""
serviceName="s:crmServices" wsdlURL="{{custom.path}}/crmServices.wsdl"

<bean class="org.apache.cxf.transport.common.gzip.GZIPInInterceptor" />
<entry key="dataFormat" value="PAYLOAD" />


Backend endpoint:
<cxf:cxfEndpoint id="CustomUI_CKM_Insert_Incident"

<bean class="org.apache.cxf.transport.common.gzip.GZIPInInterceptor" />
<entry key="dataFormat" value="PAYLOAD" />


And a fragment of working Camel route:

<camelContext xmlns=""
trace="true" streamCache="true">
<propertyPlaceholder id="properties"
location="file:r:/smx/etc/" propertiesParserRef="jasypt" />

<from uri="cxf:bean:crmServices?dataFormat=PAYLOAD" />


<xpath>/crm:CreateRequest/in/caseType/text() =

<setHeader headerName="operationName">

<setHeader headerName="operationNamespace">

<setHeader headerName="SOAPAction">

<convertBodyTo type="String" charset="UTF-8" />

<to uri="xslt:file:{{custom.path}}/createRequestIncident.xsl" />

<convertBodyTo type="org.apache.camel.component.cxf.CxfPayload" />

<to uri="cxf:bean:CustomUI_CKM_Insert_Incident" />

<to uri="xslt:file:{{custom.path}}/createRequestIncidentResponse.xsl" />


View this message in context:
Sent from the ServiceMix - User mailing list archive at

View raw message