I am trying to create a custom component to manage my Web Services. 
So far I have created a class that contains a variable of type 
mx.servicetags.HTTPService as follows:


class DataManager extends Object{
public var requestService:mx.servicetags.HTTPService;
public function ASDataManager(){
super();
// mx.servicetags.HTTPService.initialize()
requestService = new mx.servicetags.HTTPService()
requestService.url 
= "http://bheitstuman03/GBOS/ObjectService.asmx/requestObjects";
requestService.method = "get"
requestService.resultFormat = "object"
var params:Object = new Object()
params.objectXML = ""
params.credentials = "UserBob;BobsPassword"
requestService.request = params
requestService.addEventListener("fault", 
this.handleFault);
}
public function getData(){
requestService.send()
var test:Object
test = requestService.result
}
public function handleFault(event):Void{
trace("Send Fault");
}

}

However, when I create an instance of this above DataManager and 
call the getData method, it doesn't work. After stepping through 
the code, I noticed that it does call the HTTPService's send method 
but the local _document variable has no value. I also noticed that 
the initialized function sets this variable's value as follows:

public function initialized(document : Object, id : String) : Void
{
_id = id;
_document = document;
}


Does anyone know how to instantiate a working HTTPService object 
within ActionScript?






Reply via email to