Hi

See this page
http://camel.apache.org/how-to-use-camel-as-a-http-proxy-between-a-client-and-server.html

You need to set throwExceptionOnFailure=false

And error code 3xx is redirect error codes. So your client should then
call again with the redirected url.
The redirect url should be returned in the http headers


On Fri, May 31, 2013 at 11:54 AM, indrayani <ind.k...@gmail.com> wrote:
> Hi All,
> I have defined a following route in my camel config xml
>
> <route>
>
>     <from uri="servlet:///hello"/>
>     <to uri="http://localhost:8085/testagent?bridgeEndpoint=true"; />
> </route>
>
> I am sending a request through following code from a web application :
>
> String servletURL
> ="http://localhost:8085/camel-example-servlet-tomcat-no-spring-2.11.0/camel/hello?name=test123";;
>
> HttpClient client = new DefaultHttpClient();
> HttpPost post = new HttpPost(servletURL);
> HttpResponse response = client.execute(post, context);
>
> when i execute this code , I am getting following error
>
>  caught: org.apache.camel.component.http.HttpOperationFailedException: HTTP
> operation failed invoking http://localhost:8085/erpagent?name=test123 with
> statusCode: 302
>
>
> I chcked on forum regarding this error and what I understood is , we need to
> login to URL first.
> but this url "http://localhost:8085/testagent?bridgeEndpoint=true";  is just
> a simple servlet and there is no login required.
>
> So, how should I resolve this issue now, basically , I am not able to
> understanding why am I getting this exception.
>
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/regarding-status-code-302-tp5733545.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to