Hi Glen,
That's because your SOAPResponseReader consumer the response.
you just need to put the Body back as a string like this
public class SOAPResponseReader implements Processor {
@Override
public void process(Exchange e) {
String response = e.getIn().getBody(String.class);
System.out.println("This was returned - Body: " +
response);
e.getIn().setBody(response);
}
}
Or just turn the Body into String like this
from("jms:queue:numbersToDouble")
.process(new SOAPMessagePreparer())
.to(CXF_URI)
.convertBodyTo(String.class)
.process(new SOAPResponseReader())
.to("file://testfile");
Willem
Glen Mazza wrote:
Hello, the following route makes SOAP client calls and places the SOAP
responses in files in the given testfile folder:
public void configure() {
from("jms:queue:numbersToDouble")
.process(new SOAPMessagePreparer())
.to(CXF_URI)
// .process(new SOAPResponseReader())
.to("file://testfile");
}
Everything works fine. But when I place a process method between the
latter two "to" methods (i.e., uncomment the line above), the process
method will read properly the SOAP response but it seems to "eat" it so
that only blank files end up subsequently getting written to the
testfile folder.
Here's my SOAPResponseReader:
public class SOAPResponseReader implements Processor {
@Override
public void process(Exchange e) {
System.out.println("This was returned - Body: " +
e.getIn().getBody(String.class));
}
}
Any idea what's happening? What do I need to do to SOAPResponseReader
so that the final to("file://testfile") in the route will store the SOAP
response in each file again?
Thanks,
Glen