hi everybody, I have a problem using RequestBuilder.
I would like to use the yahoo GeoPlanet service
http://developer.yahoo.com/geo/geoplanet/guide/concepts.html

With this service you can retreive the WOEID of a town from the
name...

If I type the url on a browser i receive a file xml, but if I try to
call using RequestBuilder I don't receive anything...

this is my code:

private String findWoeid(String city) {

                cityWoeid = null; // example "2502265";
                String url = "http://where.yahooapis.com/v1/places.q("+city+")?
appid="+Application.YAHOO_WHEREAPI_KEY;
                System.out.println( url);
                RequestBuilder builder = new RequestBuilder(RequestBuilder.GET,
URL.encode(url));

                try {
                        Request request = builder.sendRequest(null, new 
RequestCallback() {

                                @Override
                                public void onResponseReceived(Request request, 
Response response)
{
                                         if (200 == response.getStatusCode()) {
                                                 cityWoeid =  
response.getText();
                                         }
                                }

                                @Override
                                public void onError(Request request, Throwable 
exception) {
                                         exception.printStackTrace();

                                }
                        });

                } catch (RequestException e) {
                        e.printStackTrace();
                }

                return cityWoeid;

        }

I don't receive any error, but response.getStatusCode() is always
zero.

Where I wrong?

Sorry for my english...

Thanks!

Regards.
Ale
-- 
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.


Reply via email to