Hi

Check this FAQ
http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html

In the response it may be stored in the OUT message, so you need to
check for that

if (exchange.hasOut()) {
   // get the header from the out message
} else {
  // get the header from the in message
}



On Tue, Sep 25, 2012 at 9:51 AM, balkishore <balkishore.pan...@gmail.com> wrote:
> Hi claus,
>
> How can I evaluate xpath in both process method and getProcessor method?
>
> I did something like:
>
> Processor target = chooseProcessor(exchange);
>
> XPathBuilder sessionID =
> XPathBuilder.xpath("substring(string(/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='ReplyTo']/*[local-name()='ReferenceParameters']/*[local-name()='ServiceGroupId']/text()),
> 10)", String.class);
>
> String session = sessionID.evaluate(exchange, String.class);
>
> System.out.println("The session id is:" +session);
>
> In the process and tried to print out the String session, and it was null.
>
>
> And in the getprocessor something like this:
>
>
> expression = exchange.getIn().getHeader("ServiceGroupID",
> env.xpath("substring(string(/soapenv:Envelope/soapenv:Header/wsa:ReplyTo/wsa:ReferenceParameters/axis2:Serv‌
> iceGroupId/text()), 10)", String.class));
>
> System.out.println("The expression is:" +expression);
>
> And the expression term i got is
> xpath("substring(string(/soapenv:Envelope/soapenv:Header/wsa:ReplyTo/wsa:ReferenceParameters/axis2:Serv‌
> iceGroupId/text()), 10)
>
> And it is not performing the xpath evaluation.
>
> And I am not able to initialize the term expression as string because
> getHeader() function does not accept String as input argument.
>
> I am still struck here.
>
> Please, i would appreciate any help.
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Using-a-custom-based-load-balancer-tp5719841p5719922.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to