Tengo un problemilla con un HttpService en actionscript. Os cuento lo que me pasa:
Tengo este HttpService creado:
Código ActionScript :
var URL:String = "http://gutenberg.dcs.fi.uva.es/~bhscmcyt/census/sparql_wrapper.php?default-graph-uri=http://census.lab216.com/censo/2001&query=ASK%20FROM%20%3Chttp%3A//census.lab216.com/censo/2001%3E%20WHERE%20%7B%20%3Chttp%3A//census.lab216.com/censo/2001/personas/0019090003%3E%20%3Fb%20%3Fc.%20%7D&format=xml" httpService.url = URL; httpService.useProxy = true; httpService.resultFormat = HTTPService.RESULT_FORMAT_E4X //Añadimos los listeners httpService.addEventListener(ResultEvent.RESULT, Respuesta); httpService.addEventListener(FaultEvent.FAULT, HayError); httpService.send();
Y las funciones de los listener:
Código ActionScript :
private function Respuesta(event:ResultEvent):void{ httpService.removeEventListener(ResultEvent.RESULT, Respuesta); httpService.removeEventListener(FaultEvent.FAULT, HayError); var uriCorrecta:Boolean = event.result.sparql.boolean; if(uriCorrecta){ Alert.show("Existe"); }else{ Alert.show("No Existe"); } } //Creamos la función “HayError” para que nos informe en caso de un error en la conexión private function HayError(event:FaultEvent):void { httpService.removeEventListener(ResultEvent.RESULT, Respuesta); httpService.removeEventListener(FaultEvent.FAULT, HayError); Alert.show("Error al comprobar la URL"); }
Pues bien, el httpService siempre me falla (ejecuta la funcion HayError) y no logro dar con el problema. La URL esta bien ya que puesta en el navegador muestra el booleano que busco en formato xml (se puede ver el código del xml dando a mostrar codigo en dicha página).
Si alguien me echa una mano le estaria muy agradecido.
Un saludo y muchas gracias a todos!