Re: access to domain external feeds
again HELP!!! thank's for the tip, I have tried the json wrapper workaround (2nd server) to access my json data. I wrote a little php script that gets my json tree from an external url and adds the callback javascript function. In the browser, I get smthing that seems to be OK. But the GWT java code is not happy with that. url of my 2nd server: http://www.touroutoukou.net/on-vieillit/urlCallbackWrapper.php?url=zobcallback=callback0 the raw json feed I want to marshal in my GWT application === http://api.flickr.com/services/feeds/photos_public.gne?format=jsonid=28208...@n00tags=onviellit php script: ?php header('Content-Type: text/javascript'); header('Cache-Control: no-cache'); header('Pragma: no-cache'); $callback = trim($_GET['callback']); echo $callback; echo '('; $html = strtolower(file_get_contents(http://api.flickr.com/services/ feeds/photos_public.gne?format=jsonid=28208...@n00tags=onviellit)); echo $html; echo ');'; ? On Sep 16, 1:59 pm, Lars Erik Karlsen larse...@gmail.com wrote: Here are two workarounds for the Same Origin Policy (SOP). http://code.google.com/webtoolkit/tutorials/1.6/Xsite.html - lek daowrote: nobody, really? tell me at least if it is too obvious, or not applyable, etc On Sep 14, 4:28 pm,daodao.ho...@gmail.com wrote: nobody wants to help me? On 9 sep, 23:28,daodao.ho...@gmail.com wrote: hello, A very easy question for you web policy expert guys: I want to make an application that uses data from anexternalURL. It is an atom feed (could be an RSS one) from flickr. I just want to fetch some photos from my flickr account. The typical URL is feed://api.flickr.com/services/feeds/photos_public.gne? id=28208...@n00 you can see that it is an different origin URL, so it is not applyable with GWT requestbuilder, isn't it (seehttp://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_SOP) Therefore, what's the best practice to use those data in my GWT app? I did not catch if there is a workaround, if I have to use GWT an other way? I have nevertheless tried the request buider with this URL. I was surprised of the behaviour: response.getStatusCode() is 0 (why 0?, not an HTTP valid code, isn't it? response.getStatusText() is empty. response.getText() is empty. what does it mean? please give me a clue !!! below the piece of code I wrote: public FlickrFeedAnalyser(final String url, final FlexTableFillerCallback callback) { photos = new ArrayListPhoto(); RequestBuilder builder = new RequestBuilder (RequestBuilder.GET, url); System.out.println(url); try { Request response = builder.sendRequest(null, new RequestCallback() { public void onError(Request request, Throwable exception) { System.out.println (exception); } public void onResponseReceived(Request request, Response response) { Document feed = XMLParser.parse (response.getText()); if (response.getText().length() 10) { DialogBox error = new DialogBox(); error.setText (code:+response.getStatusCode()+ - msg+response.getStatusText()); error.show(); } NodeList entries = feed.getElementsByTagName(entry); if (entries.getLength()==0) System.out.println (feed); for (int i = 0; i entries.getLength(); i++) { photos.add(new Photo (entries.item(i))); } callback.callback(photos); } }); } catch (RequestException e) { System.out.println(e); } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: access to domain external feeds
nobody, really? tell me at least if it is too obvious, or not applyable, etc On Sep 14, 4:28 pm, dao dao.ho...@gmail.com wrote: nobody wants to help me? On 9 sep, 23:28, dao dao.ho...@gmail.com wrote: hello, A very easy question for you web policy expert guys: I want to make an application that uses data from anexternalURL. It is an atom feed (could be an RSS one) from flickr. I just want to fetch some photos from my flickr account. The typical URL is feed://api.flickr.com/services/feeds/photos_public.gne? id=28208...@n00 you can see that it is an different origin URL, so it is not applyable with GWT requestbuilder, isn't it (seehttp://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_SOP) Therefore, what's the best practice to use those data in my GWT app? I did not catch if there is a workaround, if I have to use GWT an other way? I have nevertheless tried the request buider with this URL. I was surprised of the behaviour: response.getStatusCode() is 0 (why 0?, not an HTTP valid code, isn't it? response.getStatusText() is empty. response.getText() is empty. what does it mean? please give me a clue !!! below the piece of code I wrote: public FlickrFeedAnalyser(final String url, final FlexTableFillerCallback callback) { photos = new ArrayListPhoto(); RequestBuilder builder = new RequestBuilder (RequestBuilder.GET, url); System.out.println(url); try { Request response = builder.sendRequest(null, new RequestCallback() { public void onError(Request request, Throwable exception) { System.out.println (exception); } public void onResponseReceived(Request request, Response response) { Document feed = XMLParser.parse (response.getText()); if (response.getText().length() 10) { DialogBox error = new DialogBox(); error.setText (code:+response.getStatusCode()+ - msg+response.getStatusText()); error.show(); } NodeList entries = feed.getElementsByTagName(entry); if (entries.getLength()==0) System.out.println (feed); for (int i = 0; i entries.getLength(); i++) { photos.add(new Photo (entries.item(i))); } callback.callback(photos); } }); } catch (RequestException e) { System.out.println(e); } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: access to domain external feeds
Here are two workarounds for the Same Origin Policy (SOP). http://code.google.com/webtoolkit/tutorials/1.6/Xsite.html - lek dao wrote: nobody, really? tell me at least if it is too obvious, or not applyable, etc On Sep 14, 4:28 pm, dao dao.ho...@gmail.com wrote: nobody wants to help me? On 9 sep, 23:28, dao dao.ho...@gmail.com wrote: hello, A very easy question for you web policy expert guys: I want to make an application that uses data from anexternalURL. It is an atom feed (could be an RSS one) from flickr. I just want to fetch some photos from my flickr account. The typical URL is feed://api.flickr.com/services/feeds/photos_public.gne? id=28208...@n00 you can see that it is an different origin URL, so it is not applyable with GWT requestbuilder, isn't it (seehttp://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_SOP) Therefore, what's the best practice to use those data in my GWT app? I did not catch if there is a workaround, if I have to use GWT an other way? I have nevertheless tried the request buider with this URL. I was surprised of the behaviour: response.getStatusCode() is 0 (why 0?, not an HTTP valid code, isn't it? response.getStatusText() is empty. response.getText() is empty. what does it mean? please give me a clue !!! below the piece of code I wrote: public FlickrFeedAnalyser(final String url, final FlexTableFillerCallback callback) { photos = new ArrayListPhoto(); RequestBuilder builder = new RequestBuilder (RequestBuilder.GET, url); System.out.println(url); try { Request response = builder.sendRequest(null, new RequestCallback() { public void onError(Request request, Throwable exception) { System.out.println (exception); } public void onResponseReceived(Request request, Response response) { Document feed = XMLParser.parse (response.getText()); if (response.getText().length() 10) { DialogBox error = new DialogBox(); error.setText (code:+response.getStatusCode()+ - msg+response.getStatusText()); error.show(); } NodeList entries = feed.getElementsByTagName(entry); if (entries.getLength()==0) System.out.println (feed); for (int i = 0; i entries.getLength(); i++) { photos.add(new Photo (entries.item(i))); } callback.callback(photos); } }); } catch (RequestException e) { System.out.println(e); } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: access to domain external feeds
nobody wants to help me? On 9 sep, 23:28, dao dao.ho...@gmail.com wrote: hello, A very easy question for you web policy expert guys: I want to make an application that uses data from an external URL. It is an atom feed (could be an RSS one) from flickr. I just want to fetch some photos from my flickr account. The typical URL is feed://api.flickr.com/services/feeds/photos_public.gne? id=28208...@n00 you can see that it is an different origin URL, so it is not applyable with GWT requestbuilder, isn't it (seehttp://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_SOP) Therefore, what's the best practice to use those data in my GWT app? I did not catch if there is a workaround, if I have to use GWT an other way? I have nevertheless tried the request buider with this URL. I was surprised of the behaviour: response.getStatusCode() is 0 (why 0?, not an HTTP valid code, isn't it? response.getStatusText() is empty. response.getText() is empty. what does it mean? please give me a clue !!! below the piece of code I wrote: public FlickrFeedAnalyser(final String url, final FlexTableFillerCallback callback) { photos = new ArrayListPhoto(); RequestBuilder builder = new RequestBuilder (RequestBuilder.GET, url); System.out.println(url); try { Request response = builder.sendRequest(null, new RequestCallback() { public void onError(Request request, Throwable exception) { System.out.println (exception); } public void onResponseReceived(Request request, Response response) { Document feed = XMLParser.parse (response.getText()); if (response.getText().length() 10) { DialogBox error = new DialogBox(); error.setText (code:+response.getStatusCode()+ - msg+response.getStatusText()); error.show(); } NodeList entries = feed.getElementsByTagName(entry); if (entries.getLength()==0) System.out.println (feed); for (int i = 0; i entries.getLength(); i++) { photos.add(new Photo (entries.item(i))); } callback.callback(photos); } }); } catch (RequestException e) { System.out.println(e); } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---