Hi,
I just used the stockwatcher example for querying webservice which
return JSON data , but i dont get the response , i get a status code
of 0
The webservice is hosted on an appengine and is online, when i access
the URL directly on the browser i am able to get the data on the
browser.
I am quite sure that the code used is correct because when i changed
someother URL which is hosts webservice i get the proper response.
Is there any setting that has to be done on the appengine that hosts
the webservie
I used the following code snippet from stockwatcher for querying
RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url);
try {
Request request = builder.sendRequest(null, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response
response) {
// TODO Auto-generated method stub
if (200 == response.getStatusCode()) {
String resp = response.getText();
System.out.println("Response "+resp);
} else {
displayError("Couldn't retrieve JSON (" +
response.getStatusText()
+ ")" + "Text "+response.getStatusText());
}
}
@Override
public void onError(Request request, Throwable exception) {
// TODO Auto-generated method stub
displayError("OnError: Couldn't retrieve JSON");
}
});
} catch (RequestException e) {
displayError("Couldn't retrieve JSON");
}
Thanks in advance
Riyaz
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.