I had this same issue. What I found out was that my script response from my JSONP service was failing, and that caused the timeout. Specifically, what my JSONP service did was add a couple of underscores to the beginning of the callback name as the variable name and use var to put the JSON in it. Well that failed since the GWT callback name has a dot in it. So I changed my JSONP service to call the callback with the JSON embedded and all works well.
Turn on FireBug and see if you get any script errors. On Jan 5, 3:01 pm, Ryan <[email protected]> wrote: > Hi All, > > I've been experimenting with the <a href="http://google-web- > toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/jsonp/client/ > JsonpRequestBuilder.html">JsonpRequestBuilder</a> that comes with GWT > 2.0 and it works fine when I connect to the Google calendar service > shown in docs but I'm having trouble with the response timing out when > I try to connect to a service running locally in the same gwt > application. Just as an experiment I stripped down the example to the > bare minimum, removing the JavaScript overlay class and came up with > this: > > String url = "http://www.google.com/calendar/feeds/developer- > [email protected]/public/full?alt=json-in-script"; > > JsonpRequestBuilder jsonp = new JsonpRequestBuilder(); > jsonp.requestObject(url, new AsyncCallback() { > public void onFailure(Throwable throwable) { > Window.alert("Failed! " + throwable.toString()); > } > > public void onSuccess(Object feed) { > Window.alert("Success! " + feed); > } > > }); > > The above works fine but when I change to url to: > > "http://localhost:8888/myapp/myapp?something" > > I get the client side timeout even though the service is being > connected to is returning a result. > > I should note that I'm able to contact the same service running > locally using the <a href="http://google-web-toolkit.googlecode.com/ > svn/javadoc/2.0/com/google/gwt/http/client/ > RequestBuilder.html">RequestBuilder</a>. > > Does the JsonpRequestBuilder only work when the service is located on > a different domain? > > Thank you.
-- 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.
