Hi all,
I'm developing a widget that access to a XML file in an external server to load dynamic information. The application works fine in Adobe Flash Builder in my local machine, but when I upload the application to the web server it doesn't works, and I'm not able to access to the external xml file (in different domain that my server and my machine), and debugging in Mozilla I've seen that the application fault doing a GET of crossdomail.xml file from the external server where is the xml file I'm trying to download. Any idea how to solve that? (as the external server from I'm trying to download the xml file, it's not our server, I can't put there this crossdomain file.)
You can see below a little extract of code used to connect to download a external xml file:
private var loader:URLLoader = new URLLoader();
private var request:URLRequest = new URLRequest("http://ovc.catastro.meh.es/ovcservweb/OVCSWLocalizacionRC/OVCCallejeroCodigos.asmx/ConsultaMunicipio...");
loader.addEventListener(Event.COMPLETE, onComplete);
loader.load(request);
....
Thanks a lot in advance.
<fx:Declarations> <s:HTTPService id="srv" result="srv_resultHandler(event)" resultFormat="xml" url="http://ovc.catastro.meh.es/ovcservweb/OVCSWLocalizacionRC/OVCCallejeroCodigos.asmx/ConsultaMunicipioCodigos"> <s:request xmlns=""> <CodigoProvincia>30</CodigoProvincia> <CodigoMunicipio></CodigoMunicipio> <CodigoMunicipioIne></CodigoMunicipioIne> </s:request> </s:HTTPService> </fx:Declarations>
Hi all,
I'm developing a widget that access to a XML file in an external server to load dynamic information. The application works fine in Adobe Flash Builder in my local machine, but when I upload the application to the web server it doesn't works, and I'm not able to access to the external xml file (in different domain that my server and my machine), and debugging in Mozilla I've seen that the application fault doing a GET of crossdomail.xml file from the external server where is the xml file I'm trying to download. Any idea how to solve that? (as the external server from I'm trying to download the xml file, it's not our server, I can't put there this crossdomain file.)
You can see below a little extract of code used to connect to download a external xml file:
private var loader:URLLoader = new URLLoader();
private var request:URLRequest = new URLRequest("http://ovc.catastro.meh.es/ovcservweb/OVCSWLocalizacionRC/OVCCallejeroCodigos.asmx/ConsultaMunicipioCodigos?CodigoProvincia=30&CodigoMunicipio=&CodigoMunicipioIne=");
loader.addEventListener(Event.COMPLETE, onComplete);
loader.load(request);
....
Thanks a lot in advance.
The only solution is to create a 'proxy' in your server (for example a servlet that gets the url) and do the request there.
En español:
La única solución es crear alguna especie de 'proxy' en tu servidor (por ejemplo un servlet al que le pasas la url) y hacer la petición ahí.
Could you send me a link with a example? I haven't any experience creating proxy. Besides, is it needed to change my code? How would be the code in Flex to access XML file, using the proxy you refers?
En español:
¿Podrías enviarme algún enlace con algún ejemplo? No tengo experiencia en crear dicho proxy. ¿Cómo seria el código en Flex para poder descargar el fichero XML que me interesa usando el proxy que comentas? (mi servidor es un w2008 server y utilizo IIS7)