On Tue, Sep 25, 2012 at 11:37 AM, balkishore
<balkishore.pan...@gmail.com> wrote:
> Hi claus,
>
> How would i perform xpath evaluation in
>  exchange.getOut().getHeader("ServiceGroupID", String.class);
>
> I did not find any example where xpath is evaluated in the getheader()
> function.
>


You would need to do it on the body as the SOAP message includes
headers+body in the same payload.

You can create a shared builder you can use for the evaluation, as the
xpath expression would be the same
private XPathBuilder xpath = XPathBuilder.xpath("YourXPathExpressionHere");

And then when you have the response you can do.

And make sure exchange.hasOut() return true on the response, to grab
the out message.
eg see the FAQ I send a link to before.



String body = exchange.getOut().getBody(String.class);
String id = xpath.evaluate(exchange.getContext(), body);


Also note that XPath is an API there is in the JDK. So you can google
for xpath examples and use plain API from the JDK if you want.



>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Using-a-custom-based-load-balancer-tp5719841p5719930.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