Re: Getting a node from an XML using camel-cxf

2012-09-27 Thread balkishore
Hi Lars, I would like to get that element, and not to set my header. If i am not wrong, i cannot use, xpath along with getHeader() expression. -- View this message in context: http://camel.465427.n5.nabble.com/Getting-a-node-from-an-XML-using-camel-cxf-tp5720008p5720085.html Sent from the

Re: Getting a node from an XML using camel-cxf

2012-09-27 Thread balkishore
Hi Raul, Thanks for replying. But for saving the extracted element, I use a Hashmap. I just want to extract the element and store it in the Hashmap and not in the header itself. -- View this message in context:

Re: Using a custom based load balancer.

2012-09-26 Thread balkishore
Hi claus, If i use the Xpath java API, something like this: XPathExpression expression = xpath.compile(substring(string(/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='ReplyTo']/*[local-name()='ReferenceParameters']/*[local-name()='ServiceGroupId']/text()), 10)); String id =

Getting a node from an XML using camel-cxf

2012-09-26 Thread balkishore
Hi, I wanted to extract a term from my soap message, I tried using Xpath but, no matter what I try i always use to get an error: Invalid xpath expression. So i decided to take help of CXF. I came up with something like this: CxfPayloadSoapHeader payload =

Re: Using a custom based load balancer.

2012-09-26 Thread balkishore
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

Re: Using a custom based load balancer.

2012-09-25 Thread balkishore
Hi claus, How can I evaluate xpath in both process method and getProcessor method? I did something like: Processor target = chooseProcessor(exchange); XPathBuilder sessionID =

Re: Using a custom based load balancer.

2012-09-25 Thread balkishore
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. -- View this message in context:

Re: Using a custom based load balancer.

2012-09-25 Thread balkishore
Hi claus, How will I add an processor onto the hash map? Something like this yields me error map.put(id , getProcessors()); And also My code is as follow: public void process(Exchange exchange) throws Exception { Processor target = chooseProcessor(exchange);

Using a custom based load balancer.

2012-09-24 Thread balkishore
Hi, I want to perform a sticky based load balancing based on the SOAP session ID in the response. As camel's loadbalance.sticky() just check for the expression in the request, I have to implement my own custom load balancer. I gave a look at camel in action book and the information provided in

Re: Using a custom based load balancer.

2012-09-24 Thread balkishore
Hi claus, Thanks a ton for replying. 1) try to get the session id from the soap header (would not be there on the initial call) : How should I tell camel to skip the initial call and do not search for session id in the first request? -- View this message in context:

Re: Using a custom based load balancer.

2012-09-24 Thread balkishore
Hi claus, I tried implementing your logic and it is as follow: public class MyCustomLoadBalancer extends SimpleLoadBalancerSupport { public void process(Exchange exchange) throws Exception { Processor target = chooseProcessor(exchange); XPathBuilder sessionID =

Re: Using a custom based load balancer.

2012-09-24 Thread balkishore
Hi claus, Thanks a lot for replying. I implemented the idea directed by you(I really appreciate that ) But due to some reason my requests are not being forwarded, camel is continuously retrying. Here is my code for custom load balancer: public class MyCustomLoadBalancer extends

Searching for an expression in an HTTP response.

2012-09-19 Thread balkishore
How can I search for an Xpath expression in the SOAP response? from(something).loadbalnce.sticky(expression).to(something) searches for the expression in the SOAP request and doesn't checks for the expression in the SOAP response. How can I tell camel to search it in response instead? -- View

Re: Searching for an expression in an HTTP response.

2012-09-19 Thread balkishore
Hi Claus, Yes It was also posted by me. In that case I will delete this thread. I didn't knew you replied on that thread of mine. -- View this message in context: http://camel.465427.n5.nabble.com/Searching-for-an-expression-in-an-HTTP-response-tp5719571p5719585.html Sent from the Camel -

Re: Performing Sticky load balancing in Camel.

2012-09-13 Thread balkishore
I got it working, Thanks for your support and help guys! The code is as follow: .loadBalance().sticky(env.xpath(substring(string(/soapenv:Envelope/soapenv:Header/wsa:ReplyTo/wsa:ReferenceParameters/axis2:Serv‌ iceGroupId/text()), 10), String.class))

Performing Sticky load balancing in Camel.

2012-09-12 Thread balkishore
Hi I would like to perform sticky load balncing in apache camel based on the SOAP session, whcih is embedded in ServiceGroupID node of the first response. I wrote a small route as follow: from(uri) .loadBalance().sticky(xpath(query).namespaces(env).namespaces(wsa).namespaces(ax)) .to(BE1,BE2);

Re: Performing Sticky load balancing in Camel.

2012-09-12 Thread balkishore
Hi, I just created a small java program just to check if my xpath provides me with the appropriate infromation that I want(i.e the ServiceGroup ID) And I go the output as urn:uuid:99A029EBBC70DBEB221347349722532, the term after urn:uuid: is the session Id. So are the terms urn:uuid: culprit?

Re: Performing Sticky load balancing in Camel.

2012-09-12 Thread balkishore
Is substring supported in camel by the way? some thing like this xpath.compile(substring(string(/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='ReplyTo']/*[local-name()='ReferenceParameters']/*[local-name()='ServiceGroupId']/text()), 10)); Return me an error, saying

How to make Apache camel to search an expression in SOAP response.

2012-09-12 Thread balkishore
I am caught in this problem for a while now and am not able to figure out how to solve it. I have a client that sends a SOAP request and gets a SOAP response from the servers. I have written a wrote to do a sticky load balance: from(uri) .loadBalance().sticky(xpath(query2)) .to(BE1,BE2); If i

Re: SOAP session handling in load balncer

2012-09-11 Thread balkishore
Hello Willem, Thanks a ton for replying. My requests are SOAP messages and the seesion ID in AXIS2 are stored in ServiceGroupID node of the SOAP header. How can I extract this Session ID and use sticky session? is there any example that would help me understand this? any help would be really

Re: SOAP session handling in load balncer

2012-09-11 Thread balkishore
Hi Willem, My SOAP sessions are embedded in the SOAP header and my SOAP header looks like this: ?xml version=1.0 encoding=http://schemas.xmlsoap.org/soap/envelope/; standalone=no? soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; soapenv:Header

Re: SOAP session handling in load balncer

2012-09-11 Thread balkishore
Hi Willem, I am new to everything that on working on, And these things are still confusing me. Could you please explain them in more simpler term? As far I got to know, I have to get my request into camel-cxf endpoint in PAYLOAD data format and have to extract the header, then I have to use

Re: Load balancing-camel in real world

2012-08-16 Thread balkishore
I figured it out. Instead of localhost or 0.0.0.0 in the from if I directly insert the IP address of the local host and remove / after the port number in URI, everything works fine. :) So the code would would be something like this from(jetty://http://192.168.39.204:8080?matchOnUriPrefix=true;)

Load balancing-camel in real world

2012-08-15 Thread balkishore
Dear memebers, This would be my first post in this forum and I am glad. I have started using camel a while back for a project of mine to create a load balancing application. Well to start with, My load balncer would listen to a port, lets say 8080 and would balance all the incoming SOAP requests

Re: Load balancing-camel in real world

2012-08-15 Thread balkishore
Thanks for replying. But I even tried using 0.0.0.0. Still my problem is not resolved. -- View this message in context: http://camel.465427.n5.nabble.com/Load-balancing-camel-in-real-world-tp5717381p5717383.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Load balancing-camel in real world

2012-08-15 Thread balkishore
Thanks for replying. Yeah when I input http://172.28.39.138:8080/ in my browser, apache tomcat page opens. As it is a backend server, and it runs tomcat in it which is listening on the port 8080 for requests. I am still struck in this part. Am I doing something wrong? Any help would be very much

Re: Load balancing-camel in real world

2012-08-15 Thread balkishore
Thanks for replying. I changed from(jetty://http://localhost:8080/;) in my code, and still i get the same error, when i send a request. But when i type http://localhost:8080/ on my browser, i get an error like this: java.lang.IllegalArgumentException: Invalid uri: /. If you are

Re: Load balancing-camel in real world

2012-08-15 Thread balkishore
Yes I tried! But still it didn't work. I am getting this error with the bridgeEndpoint added in the code. Any help would be very much appreciated. -- View this message in context: http://camel.465427.n5.nabble.com/Load-balancing-camel-in-real-world-tp5717381p5717424.html Sent from the Camel -