I have the following in my camel context: <onException> <exception>org.apache.cxf.binding.soap.SoapFault</exception> <handled>true</handled> <to uri="a bean that sets the body to a new string, i.e. exchange.getIn().setBody(something, String.class)" /> <to uri="file:/..." /> </onException>
It does not matter what I set in the body (the something above), the file would be empty. I noticed that the body type is still CxfPayload after I did the setBody(something, String.class). However, if I add a convertBodyTo String before the bean is called, then everything would work fine: <onException> <exception>org.apache.cxf.binding.soap.SoapFault</exception> <handled>true</handled> *<convertBodyTo type="String" />* <to uri="a bean that sets the body to String, i.e. exchange.getIn().setBody(something, String.class)" /> <to uri="file:/..." /> </onException> Should setBody(something, String.class) set the body to String? Thanks in advance for any insight. -- View this message in context: http://camel.465427.n5.nabble.com/setBody-Object-body-Class-T-type-does-not-seem-to-set-the-body-type-tp5754307.html Sent from the Camel - Users mailing list archive at Nabble.com.