• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending HTTP Request in GWT

 
Jinal P Shah
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys,
I'm new to GWT. I am trying to integrate Box.net in my GWT application but I am not able to send http request to Box.net. Please can any one tell me how do you send an http request and get a http response in GWT.

Regards
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
Jinal P Shah
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. I tried that but it gives me an error Access-Control-Allow-Origin. So how do I resolve it?

Regards
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The link I posted has information on the Same Origin Policy restrictions and possible workarounds. Did you refer to that?
 
Jinal P Shah
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I saw the link and I did accordingly. I did sent the HttpRequest but now the problem is it does not get a response and I have no idea why is it so.
I can show you the code if you want and here is the link for my test
https://techchoice-2.appspot.com/
The Box-net Button is the one I am trying to implement.
See if you could help me for this.

Regards
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it does not get a response and I have no idea why is it so.

What is the response status code which you get back?
 
Jinal P Shah
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get the response code of 200 but I get an empty response. I have no idea why is it so?
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
200 indicates a successful call.
How are you checking the response?
What kind of response are you expecting from the server?
 
Jinal P Shah
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
200 indicates a successful call.

yaah 200 does indicate a successful execution but I still get an empty response.
How are you checking the response?
What kind of response are you expecting from the server?

I am using FireBug to check the response and I am expecting an XML response.

I am calling a rest service of Box.net and I am expecting an XML response from the api. But I am not getting it.

 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the code where you build the request, make the call and process the response.
 
Jinal P Shah
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the code
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic