3 Replies Latest reply on Mar 26, 2011 9:35 AM by megharajdeepak

    How to use Google weather API in flex?

    megharajdeepak Level 1

      Hi there,

       

      I have 2 services.

      ServiceONE : http://api.locationservice.com/city/key=123abc

      ServiceTWO: http://www.google.co.in/ig/api?weather='anyCityName'

       

      I am using HTTPService for both. Firstly I fetch result which gives me city name, by sending ServiceONE. And then, I am assigning this city name to SericeTWO and sending it, which gives me weather details about that city.

       

      I am hosting my applicaition on some server, http://www.somethirdpartyserver.com/myaccount/myflexstuff/MyWeatherApplication.html

       

      Since it tries to access http://api.locationservice.com/city/key=123abc and http://www.google.co.in/ig/api?weather='anyCityName', I would need to have crossdomain.xml in them.

       

      Fortunately I could find http://api.locationservice.com/crossdomain.xml, which has:

      <?xml  version="1.0" ?>
      <!DOCTYPE  cross-domain-policy (View Source for full doctype...)>
      - <cross-domain-policy>
      <site-control permitted-cross-domain-policies="all" />
      <allow-access-from domain="*" secure="true" />
      <allow-http-request-headers-from domain="*" headers="*" secure="true" />
      </cross-domain-policy>

      Which mean, any server can access it.

      But unfortunately, I couldnot find something similar in http://www.google.co.in/crossdomain.xml. Though xml is there, the code is different:
      <?xml  version="1.0" ?>
      <!DOCTYPE  cross-domain-policy (View Source for full doctype...)>
      - <cross-domain-policy>
      <site-control permitted-cross-domain-policies="by-content-type" />
      </cross-domain-policy>

      It doesn't allow any access to any domain.....

      I've already developed the weather gadget in flex but I cant host it for use anywhere, because of this security issue
      Can anyone kindly help me how can this be resolved?>?

      -Deepak