You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by atg roxx <at...@gmail.com> on 2012/02/15 14:54:23 UTC

Not getting any response from rest serivce

Hi All.

I am facing a issue. I am trying to connect to rest service and want to
process the response which I receive.
But I was not getting any response.

So I thought to try simple  connection to google and see if any response
comes from there.

strange that I am not even getting any response from google.
I am getting : " java.lang.IllegalStateException: IllegalStateException
invoking http://www.google.com: Already connected"

my route is defined like this:


from("jms:request")
 .log("Output:")
.to(ExchangePattern.InOut,"cxfrs://http://www.google.com")
         .log("Output:")
        .process(new Processor() {
 @Override
public void process(Exchange exchange) throws Exception {
System.out.println("response is "+ exchange.getOut().getBody());
 }
});



-----------------------------------------------

Kindly let me know where I am going wrong.

--cheers,
atg roxx

Re: Not getting any response from rest serivce

Posted by atg roxx <at...@gmail.com>.
HI   Willem Jiang ,

Thanks for replying ..
I found the issue. The  issue was that I was using
"System.out.println("response is "+ exchange.getOut().getBody());"

instead I should have used "System.out.println("response is "+
exchange.getIn().getBody());"

getOut and getIn was the issue.

Also the error msg which i have posted
"I am getting : " java.lang.**IllegalStateException: IllegalStateException
invoking http://www.google.com: Already connected"

was a warning msg which I received when I kept all logs in debug mode.



thanks;

-cheers,
atg roxx

On Wed, Feb 15, 2012 at 2:27 PM, Willem Jiang <wi...@gmail.com>wrote:

> Not sure why are you trying to use cxfrs to send the request to google.
> First, google doesn't provide the REST service,
> Second, you need to prepare the parameter for the cxfrs to send.
>
> Can you try to use the camel-http component to send the request ?
>
>
> On Wed Feb 15 21:54:23 2012, atg roxx wrote:
>
>> Hi All.
>>
>> I am facing a issue. I am trying to connect to rest service and want to
>> process the response which I receive.
>> But I was not getting any response.
>>
>> So I thought to try simple  connection to google and see if any response
>> comes from there.
>>
>> strange that I am not even getting any response from google.
>> I am getting : " java.lang.**IllegalStateException: IllegalStateException
>> invoking http://www.google.com: Already connected"
>>
>> my route is defined like this:
>>
>>
>> from("jms:request")
>>  .log("Output:")
>> .to(ExchangePattern.InOut,"**cxfrs://http://www.google.com"**)
>>          .log("Output:")
>>         .process(new Processor() {
>>  @Override
>> public void process(Exchange exchange) throws Exception {
>> System.out.println("response is "+ exchange.getOut().getBody());
>>  }
>> });
>>
>>
>>
>> ------------------------------**-----------------
>>
>> Kindly let me know where I am going wrong.
>>
>> --cheers,
>> atg roxx
>>
>>
>
>
> --
> Willem
> ------------------------------**----
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.**com<http://willemjiang.blogspot.com>(English)
>        http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang Weibo: willemjiang
>

Re: Not getting any response from rest serivce

Posted by Willem Jiang <wi...@gmail.com>.
Not sure why are you trying to use cxfrs to send the request to google.
First, google doesn't provide the REST service,
Second, you need to prepare the parameter for the cxfrs to send.

Can you try to use the camel-http component to send the request ?

On Wed Feb 15 21:54:23 2012, atg roxx wrote:
> Hi All.
>
> I am facing a issue. I am trying to connect to rest service and want to
> process the response which I receive.
> But I was not getting any response.
>
> So I thought to try simple  connection to google and see if any response
> comes from there.
>
> strange that I am not even getting any response from google.
> I am getting : " java.lang.IllegalStateException: IllegalStateException
> invoking http://www.google.com: Already connected"
>
> my route is defined like this:
>
>
> from("jms:request")
>   .log("Output:")
> .to(ExchangePattern.InOut,"cxfrs://http://www.google.com")
>           .log("Output:")
>          .process(new Processor() {
>   @Override
> public void process(Exchange exchange) throws Exception {
> System.out.println("response is "+ exchange.getOut().getBody());
>   }
> });
>
>
>
> -----------------------------------------------
>
> Kindly let me know where I am going wrong.
>
> --cheers,
> atg roxx
>



-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang 
Weibo: willemjiang