You can transform the message before sending to the JMS queue. And then afterwards transform the message to the fault message.
For example add a for that.
Thanks for reply. I was able to transform accordingly to send to queue, but i am facing issues in setting the fault response.
I am actually invoking a bean implementing the exchange wherein I am trying to create a SOAPMessage.
I found an example for the same in : http://camel.apache.org/cxf-example.html
But I am finding it diffuclt to convert the exchanges's in body to a SOAPMessage i.e by the following:
SOAPMessage soapMessage = (SOAPMessage)exchange.getIn().getBody(List.class).get(0);
This is actually returning me a null but when i print out the exchange i can see the entire SOAP message.
So please help me out here, Am i doing anything wrong in the conversion?
Aslo I have an question, the exchange coming out of an cxf endpoint is of camel exchange message or of cxf exchange message? And is there any way I can convert from one to the other?
Just get the plain body, and then work your way from there, what it really is
Object body = exchange.getIn().getBody();
And when you say printing a the message you can see the soap message? What do you see? XML data? If so that may be because the object has a toString method that prints it nicely in XML, or that the message is just plain XML etc.