Why are you setting:

xmlRequest.contentType = "Application/xml";

 

I have seen this cause people problems.  Leave the default and see if
that helps.

 

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of barry.beattie
Sent: Monday, May 14, 2007 12:20 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] events not being called: HTTPService

 

I'm trying to retrieve a static XML doc for processing.

I can step thru all the way to 

trace("xmlRequest.send");

but after that it won't go into either listener method:
onResultReturn()
onResultFault()
and after xmlRequest.send(), the app returns back to the calling code

then an error is thrown on the first use of the XML (null reference-
it's missing). 
what I'm trying to do is so simple, I think I'm suffering code blindness

can anyone spot where I'm going wrong?
thanx
b

[Bindable]
public var questionaire:XML;
[Bindable]
public var xmlRequest:HTTPService = new HTTPService();

public var xmlLocation:String = "./questionaire.xml"; 

public function getQuestions(xmlLocation:String):void
{
trace("getQuestions called");
xmlRequest.url = xmlLocation;
trace("xmlLocation:" + xmlLocation);
xmlRequest.method = "GET";
xmlRequest.contentType = "Application/xml";
xmlRequest.resultFormat = "e4x";
xmlRequest.addEventListener(ResultEvent.RESULT,onResultReturn);
xmlRequest.addEventListener(FaultEvent.FAULT, onResultFault);
trace("xmlRequest.send");
xmlRequest.send(); 
}
public function onResultReturn(event:ResultEvent):void
{
trace("onResultReturn called");
questionaire = new XML(event.result);
trace(questionaire.toXMLString());
}

public function onResultFault(event:FaultEvent):void
{
trace("onResultFault called:" + event.toString())
}

 

Reply via email to