Sorry, I thought it was working, but Im a little confused about the "this" in the example. Where do I define the event that picks up the result?
On 11/2/05, NEILHIGHLEY.COM <[EMAIL PROTECTED]> wrote: > Magic! I could not have prayed to Jupiter for a more complete answer! :) > > Anyone stumbling onto this email in future should bear in mind to > amend the following lines in the WSProxy file : > > import mx.services.*; > import mx.events.EventDispatcher; > > dynamic class WSProxy { > > > Neil > > > On 11/2/05, Mischa Williamson <[EMAIL PROTECTED]> wrote: > > Hey, > > > > I've uploaded a simple WSProxy class that should help you with this: > > > > http://freeform-systems.com/share/actionscript/WSProxy.as > > > > You will want to change the EventDispatcher class to MM's version. Change > > this line: > > > > import com.ffsys.events.EventDispatcher; > > > > to wherever MM's class is, it i remember correctly it should be: > > > > import mx.events.EventDispatcher; > > > > Then you can use it like this: > > > > var ws:WSProxy = new WSProxy( "http://www.domain.com/service.wsdl" ); > > ws.addEventListener( "result", this ); > > ws.addEventListener( "fault", this ); > > ws.callSomeMethodWithArgs( arg1, arg2 ); > > > > Hope it helps. > > > > cheers -- mischa > > > > On 11/2/05, NEILHIGHLEY.COM <http://NEILHIGHLEY.COM> <[EMAIL PROTECTED]> > > wrote: > > > > > > Hello all, > > > > > > Webservice question.. > > > > > > I have an app that loads in records from a webservice class using the > > > mx.services.webservice classes. > > > This is called as a standalone class with the various webservices as > > > functions each containing their own event listeners.. > > > > > > e.g. > > > function wsRequest():Void{ > > > if(_root._webServicePending==false){ > > > _root._webServicePending=true; > > > wsCall=webService.fileList(); > > > wsCall.onResult=function(result):Void{ > > > _root._xmlFileList=result; > > > _root._webServicePending=false; > > > } > > > wsCall.onFault=function(fault:Object):Void > > > { > > > _root._wsFaultID=fault.faultcode; > > > _root._wsFaultDescription=fault.faultstring; > > > } > > > } > > > } > > > > > > As you can see I am using a couple of root variables to store the > > > status of the current webservice request ( restricting the class to > > > one call at a time ) and the resulting xml returned. > > > > > > What I would like to know how to do is to have a class that can query > > > the webservice and populate itself, without having the go-between of > > > placing the result in the root. > > > So the onResult passes the result to the calling class in one way or > > > another. > > > Preferably I would like the result returned to a callback of some > > > sort, would I use event dispatch? How would I do it, considering I > > > have a class as follows. > > > > > > class myClass{ > > > > > > var theFileList:XML; > > > var thisWebService:WebService; > > > > > > function myClass(){ > > > > > > } > > > > > > function getFileList(){ > > > theFileList=thisWebService.wsRequest(); //this obviously doesnt work > > > > > > } > > > } > > > > > > Would I add a listener somewhere? > > > Would I create a listener in the root? > > > > > > Neil Highley > > > _______________________________________________ > > > Flashcoders mailing list > > > Flashcoders@chattyfig.figleaf.com > > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > _______________________________________________ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > -- > www.neilhighley.com > -- www.neilhighley.com _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders