Thanks for your help. Yes, I realize that the web service is called asynchronously. However, I had not gotten that far yet. The HTTPService.send method did not make a request to my web service (which I was monitoring) and so I knew something was not working.
What values could I try passing to the initialized method. Is "id" the name of the HTTPService? What could I pass as an document object? Bill --- In [email protected], Matt Chotin <[EMAIL PROTECTED]> wrote: > Creating an HTTPService not through a tag is not officially supported right > now. I don't remember if not calling initialized will actually hurt you, > mostly it would screw up validation if you had any but I think it should be > OK. The bigger problem is that you're trying to access the result too > quickly. You need to do it in a result handler (addEventListener ("result")) > since the call is asynchronous. Don't forget to use Delegates. > > > > Matt > > > > _____ > > From: billheit [mailto:[EMAIL PROTECTED] > Sent: Monday, February 21, 2005 1:05 PM > To: [email protected] > Subject: [flexcoders] Instantiate an HTTPService object in ActionScript > > > > > 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 > <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? > > > > > > > > > > Yahoo! Groups Sponsor > > > > <http://us.ard.yahoo.com/SIG=129i3ttta/M=324658.6070095.7083352.30011 76/D=gr > oups/S=1705007207:HM/EXP=1109106304/A=2343726/R=0/SIG=12imu8r9h/*http :/clk.a > tdmt.com/VON/go/yhxxxvon01900091von/direct/01/&time=1109019904991955> > <http://us.ard.yahoo.com/SIG=129i3ttta/M=324658.6070095.7083352.30011 76/D=gr > oups/S=1705007207:HM/EXP=1109106304/A=2343726/R=1/SIG=12imu8r9h/*http :/clk.a > tdmt.com/VON/go/yhxxxvon01900091von/direct/01/&time=1109019904991955> > > Get unlimited calls to > <http://us.ard.yahoo.com/SIG=129i3ttta/M=324658.6070095.7083352.30011 76/D=gr > oups/S=1705007207:HM/EXP=1109106304/A=2343726/R=1/SIG=12imu8r9h/*http :/clk.a > tdmt.com/VON/go/yhxxxvon01900091von/direct/01/&time=1109019904991955> > > U.S./Canada > <http://us.ard.yahoo.com/SIG=129i3ttta/M=324658.6070095.7083352.30011 76/D=gr > oups/S=1705007207:HM/EXP=1109106304/A=2343726/R=1/SIG=12imu8r9h/*http :/clk.a > tdmt.com/VON/go/yhxxxvon01900091von/direct/01/&time=1109019904991955> > > > <http://view.atdmt.com/VON/view/yhxxxvon01900091von/direct/01/&time=1 1090199 > 04991955> > > > > <http://us.adserver.yahoo.com/l? M=324658.6070095.7083352.3001176/D=groups/S= > :HM/A=2343726/rand=180738204> > > > > _____ > > Yahoo! Groups Links > > * To visit your group on the web, go to: > http://groups.yahoo.com/group/flexcoders/ > <http://groups.yahoo.com/group/flexcoders/> > > * To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED] subject=Unsubscribe> > > * Your use of Yahoo! Groups is subject to the Yahoo! > <http://docs.yahoo.com/info/terms/> Terms of Service.

