camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From balkishore <balkishore.pan...@gmail.com>
Subject Re: Using a custom based load balancer.
Date Wed, 26 Sep 2012 09:37:47 GMT
Hi claus,
Thanks for replying.

But why do i always get an error invalid xpath expression, when the same
xpath expression works fine with java API. 

I also tried the java API version and again i got an error saying the body
is empty.
And in real the body is empty, because the content are present only in the
soap header.

I tried something like:

if (exchange.hasOut())
{
Document payload = exchange.getOut().getBody(Document.class); 
XPath xpath = XPathFactory.newInstance().newXPath();
XPathExpression expression =
xpath.compile("substring(string(/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='ReplyTo']/*[local-name()='ReferenceParameters']/*[local-name()='ServiceGroupId']/text()),
10)");

String id1 = expression.evaluate(payload);
System.out.println("id 1 is:" + id1);
map.put(id1 , getProcessors().get(0));
		}

But i get an error body is empty and [Fatal Error] :1:1: Premature end of
file

I don't understand what wrong i am doing here.



--
View this message in context: http://camel.465427.n5.nabble.com/Using-a-custom-based-load-balancer-tp5719841p5720013.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message