camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pratibhaG <pratibha.ghog...@in2m.com>
Subject Re: How to use setBody and xpath together?
Date Thu, 23 Oct 2008 12:47:05 GMT

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>pratibha.ghogale@in2m.com</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>pratibha.ghogale@in2m.com</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>pratibha.ghogale@in2m.com</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>pratibha.ghogale@in2m.com</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.


Mime
View raw message