Comunidad de diseño web y desarrollo en internet online

Problema con HttpService

Citar            
MensajeEscrito el 02 Ago 2012 04:48 pm
Buenas a todos,

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!

Por Ivanete

3 de clabLevel



 

firefox
Citar            
MensajeEscrito el 02 Ago 2012 05:31 pm
El FaultEvent tiene una propiedad message (creo, revisa la ayuda para FaultEvent), trazala o inspecciona con el debugger para ver que dice el mensaje de error

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 02 Ago 2012 07:48 pm
Buenas, acabo de ver la propiedad message con el debuger y me sale esto:

faultCode:InvokeFailed faultString:'[MessagingError message='Destination 'DefaultHTTP' either does not exist or the destination has no channels defined (and the application does not define any default channels.)']' faultDetail:'Couldn't establish a connection to 'DefaultHTTP''

Me sale esto por consola:
(mx.messaging.messages::HTTPRequestMessage)#0
body = (Object)#1
clientId = (null)
contentType = "application/x-www-form-urlencoded"
destination = ""
headers = (Object)#2
httpHeaders = (Object)#3
messageId = "F1A62FC8-62CF-8274-823C-E8D9EF6AED8D"
method = "POST"
recordHeaders = false
timestamp = 0
timeToLive = 0
url = "http://......."

La verdad que no lo entiendo, ya que si utilizas la url normal te sale lo que tiene que salir. Puede ser xq destination esta vacio (destination = ""), pero no se que habra que poner ahí. Asi que a no ser de que me abrais los ojos estoy dando palos de ciego.
Muchas gracias por responder y a los lectores.
Un saludote!

Por Ivanete

3 de clabLevel



 

firefox
Citar            
MensajeEscrito el 03 Ago 2012 04:23 pm
Ya está solucionado, era un problema con el crossdomain...
Que guerra me ha dado el puñetero... xD

Un saludo y gracias a todos!

Por Ivanete

3 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.