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.

Reply via email to