我正在使用 httpservice,一旦它被调用,什么都没有发生。我没有得到结果或错误?我添加了各种侦听器,但无法捕获任何错误。我错过了什么吗?
private function GetUsersServers():void
{
var serviceObj:HTTPService = new HTTPService();
serviceObj.resultFormat = 'text';
serviceObj.method = 'GET';
serviceObj.useProxy = false;
serviceObj.addEventListener(ResultEvent.RESULT, GetUsersServersResult);
serviceObj.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
serviceObj.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
serviceObj.addEventListener(Event.COMPLETE, onLoadComplete);
serviceObj.url = '************************';
var parameters:Object = new Object();
parameters["Username"] = m_strUserSIP;
LogAddItem( -1, "GetUsersServers Request - User = " + parameters.Username);
serviceObj.send(parameters);
}
private function onLoadComplete(e:Event):void
{
var loader:URLLoader = URLLoader(e.target);
LogAddItem( LOG_CATEGORY_MAIN_DEBUG, "securityErrorHandler: " + loader.data);
}
// check for security error - probably crossdomain issue
private function securityErrorHandler(event:SecurityErrorEvent):void {
LogAddItem( LOG_CATEGORY_MAIN_DEBUG, "securityErrorHandler: " + event);
}
public function onLoadError(e:IOErrorEvent):void {
LogAddItem( LOG_CATEGORY_MAIN_DEBUG, "Fault: " + e.text);
}
private function GetUsersServersResult(event:ResultEvent):void
{
LogAddItem( -1, "GetUsersServers Result Received..");
var rawData:String = String(event.result);
LogAddItem( -1, "GetUsersServersResult = " + rawData);
InitContinue();
}