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.