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: http://camel.465427.n5.nabble.com/Getting-a-node-from-an-XML-using-camel-cxf-tp57

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 Camel

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 o

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: CxfPayload payload = exchange.getIn().getBody(CxfPayload.class); List he

Re: Using a custom based load balancer.

2012-09-25 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

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);

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: http://camel.465427.n5.nabble.com/Using-a-custom-based-load-balance

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 = XPathBuilder.xpath("substring(string(/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name(

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 SimpleLoadBalanc

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 = XPathBuilder.xpath("subst

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: http://camel.465427.n5.nabb

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 the

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 - User

Re: Searching for an expression in an HTTP response.

2012-09-19 Thread balkishore
Hi Claus I am extremely sorry, But it doesn't make any sense to perform the path operation after the loadbalncer? If I perform the xpath after loadbalancer, does it searches for the expression in the resposne? And if I perform it after balancer, does it performs sticky load balancing based on the

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? --

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))

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 a

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 org.ap

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? Sh

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); W

Re: Using more than one namespace and calling it in Xpath.

2012-09-11 Thread balkishore
Hello Thanks a ton for replying. It worked. But Is there any tool that could help me trace the routes. As I am working on a load balncer, I would like to know which of the backend servers recieves the request. I have a client which would send request to camel, with the help of jetty and would load

Using more than one namespace and calling it in Xpath.

2012-09-11 Thread balkishore
I would like to create more than one name, something like this: Namespaces env = new Namespaces("soapenv", "http://schemas.xmlsoap.org/soap/envelope/";); Namespaces wsa = new Namespaces("wsa", "http://www.w3.org/2005/08/addressing";); Namespaces ax = new Namespaces("axis2", "http://ws.apache.org/n

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 XPath

Re: SOAP session handling in load balncer

2012-09-11 Thread balkishore
Hi Willem, I am extremely sorry, 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, th

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: http://schemas.xmlsoap.org/soap/envelope/"; standalone="no"?> http://schemas.xmlsoap.org/soap/envelope/";> http://www.w3.org/2005/08/addressing";> http://www.w3.org/2005/08/addressing/none http://ws.a

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 appre

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";)

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 -

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 forwarding/bridg

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 a

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.

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 t