camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] [Commented] (CAMEL-5833) Can't save the message from a CXF request to a file
Date Thu, 29 Nov 2012 10:36:58 GMT


Claus Ibsen commented on CAMEL-5833:


Please use the mailing lists first to get help with Camel as we say here

Your problem is related to the fact that the data is only re-adable once because its stream
based. dataFormat=RAW.
And so when you print the data using system out, then the data is no longer re-readable so
when you write the file its empty.

You can enable stream caching

To have Camel cache the stream, so it can be re-readable.
> Can't save the message from a CXF request to a file
> ---------------------------------------------------
>                 Key: CAMEL-5833
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.10.2
>            Reporter: liugang
>             Fix For: 2.11.0
> if I have following route:
> {code}
> 				from("cxf:http://localhost:8091/save2file?dataFormat=RAW&wsdlURL=file:wsdl/se.wsdl").process(new
Processor() {
> 					public void process(Exchange exchange) throws Exception {
> //						System.out.println(exchange.getIn().getBody(String.class)); // the saved file
content is none
> 						System.out.println(exchange.getIn().getBody());            // this works fine
> 					}
> 				}).to("file://output?fileName=message.txt");
> {code}
> as comment, if in Processor, I put:
> {code}
> System.out.println(exchange.getIn().getBody());
> {code}
> Then, it works fine, the file created, and the content is correct.
> but if I changed *getBody()* to *getBody(String.class)*:
> {code}
> System.out.println(exchange.getIn().getBody(String.class));
> {code}
> then, the file created by with empty content.
> Actually, the problem existed for a long time.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message