camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vikas Kumar Arora <>
Subject Camel File: how to retain Original File contents when moving file?
Date Wed, 19 May 2010 01:55:36 GMT

My use case, Bulk Load Operation where I've several thousand XML files:
1. Read XML files from a folder 
2. wrap A SOAP Message structure around that XML file
3. send it to Web Service
4. transform response from Web Service into XML response
(which it already is, but if I give the output of WS directly to XPath I get 
java.lang.ClassCastException: cannot be cast to
). Any way this works.
5. Now the problem point: now based on the SOAP message's SUCCESS or FAILURE
status, I've to move the ORIGINAL file and it's content (original of course)
to appropriate folder.
  I was going thru the docs, and some where found that there is
"useOriginalMessage", but that's only available at the "onException" element

 But In my case I dont have any exception, 

1. So I'm not sure if similar "useOriginalMessage" flag/attribute should
also be useful at the URI level say for

2. Or is there any way to hold the, original file's content in Camel Global
context (if accessible thru Camel DSL) somewhere and be available for use
later at any point.

Just like Http Session, where for a given session (or like Http Request),
where we can keep our data for the duration of the
Transaction(request/session) and use accordingly?

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns=""
	<camel:camelContext xmlns=""

			<camel:from uri="file://C:/Projec~1/Documents/xmls/xmls?noop=true"/>
			<camel:to uri="xslt:wrapXMLWithSOAPMessageStructure.xsl"/>
			<camel:to uri="bean:someBean"/>
			<camel:to uri=""/>
			<camel:to uri="xslt:SOAPResponseMessageTransform.xsl"/>


	<bean id="someBean" class="com.abcd.sample.camel.SomeBean" />

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message