The resolved error consumer consumes the message in format
<?xml version="1.0" encoding="UTF-8"?><error>
<errorCode>4000</errorCode>
<requestData><request>
<updateUserProfile>
<userName>0910user1</userName>
<firstName>pratibhaPp</firstName>
<lastName>ghogalePp</lastName>
<emailAddress>[EMAIL PROTECTED]</emailAddress>
</updateUserProfile>
</request></requestData>
<message>java.net.ConnectException: Connection refused</message>
<service>DirectorService</service>
</error>
This should set the message body as
<request>
<updateUserProfile>
<userName>0910user1</userName>
<firstName>pratibhaPp</firstName>
<lastName>ghogalePp</lastName>
<emailAddress>[EMAIL PROTECTED]</emailAddress>
</updateUserProfile>
</request>
and send it to the recipient name given in header.
I tried using splitter. It does the above but only problem is it does not
change the actual message body. If I do
exchange.getIn().getBody(String.class)
it returns me
<error>
<errorCode>4000</errorCode>
<requestData><request>
<updateUserProfile>
<userName>0910user1</userName>
<firstName>pratibhaPp</firstName>
<lastName>ghogalePp</lastName>
<emailAddress>[EMAIL PROTECTED]</emailAddress>
</updateUserProfile>
</request></requestData>
<message>java.net.ConnectException: Connection refused</message>
<service>DirectorService</service>
</error>
but I need
<request>
<updateUserProfile>
<userName>0910user1</userName>
<firstName>pratibhaPp</firstName>
<lastName>ghogalePp</lastName>
<emailAddress>[EMAIL PROTECTED]</emailAddress>
</updateUserProfile>
</request>
How to achieve this?
--
View this message in context:
http://www.nabble.com/How-to-use-setBody-and-xpath-together--tp20130051s22882p20130172.html
Sent from the Camel - Users mailing list archive at Nabble.com.