Forum Home » Fuse Distributions » Fuse Mediation Router

Thread: Camel CXF Proxy - Saving the incoming SOAP Message to a file

 
This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Apr 5, 2012 11:18 PM Last Post By: ffang
jszjsmith

Posts: 1
Registered: 04/05/12
Camel CXF Proxy - Saving the incoming SOAP Message to a file
Posted: Apr 5, 2012 1:45 PM
 
  Click to reply to this thread Reply
I've recently started looking at servicemix / camel so apologies if this is a bit of a newbie question.

I was looking at the camel cxf proxy example and have managed to route to my external axis2 web service using the below. However I would like to also save the incoming SOAP message to the file system so I added <to uri="file:camel/outputx"/>.

This causes the exception (presumably because the message is no longer routed to the axis2 ws):

<faultstring>com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
at row,col {unknown-source}: 1,0</faultstring>

Can anyone tell me how to do achieve saving the message enroute to the back end web service please ??

thanks.


<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="cxf:bean:myProxy?dataFormat=MESSAGE"/>
<log message="Moving ${file:name} to the output directory"/>
<!--
<to uri="file:camel/outputx"/>
-->
<to uri="http://0.0.0.0:8080/AXIS2-ADB/services/MyService?throwExceptionOnFailure=false"/>
</route>
</camelContext>

ffang

Posts: 1,320
Registered: 12/24/07
Re: Camel CXF Proxy - Saving the incoming SOAP Message to a file
Posted: Apr 5, 2012 11:18 PM   in response to: jszjsmith in response to: jszjsmith
 
  Click to reply to this thread Reply
Hi,

Looks like the stream was consumed before send to external ws.

You can add streamCache="true" to your camelContext, take a look at
[1] to get more details

[1]http://camel.apache.org/stream-caching.html

Freeman