Using the mxml defined service you would need to set your handlers.

So when calling the service,

Var call:AsyncToken = service.GetDataByGrouping();

Call.resultHandler = blah

Same for fault (excuse word formatting the code)

 

In terms of does it have to be mxml, obviously not, but isn’t easier?

 

Regards,

 

Bjorn Schultheiss

Senior Flash Developer

QDC Technologies


From: [email protected] [mailto:[email protected]] On Behalf Of ben.clinkinbeard
Sent: Tuesday, 4 July 2006 5:45 AM
To: [email protected]
Subject: [flexcoders] ServiceLocator - does it have to be MXML?

 

Is it possible to implement your app's ServiceLocator in ActionScript?
I strongly prefer making WebService calls in AS so I would rather do
it this way. If this is not possible, I am hoping someone can explain
how a complex call would be made. I am not currently using a Delegate
(isn't Delegate.create not necessary in AS3?), so here is the code in
my Command class.

var service:AbstractService =
ServiceLocator.getInstance().getService("industryService");
service.GetDataByGrouping();

The problem is that neither the onResult nor onFault handlers are firing.

Here is the service as defined in my Services.mxml file:

<mx:WebService id="industryService"
wsdl="myWSDL"
showBusyCursor="true"
useProxy="false"
result="event.token.resultHandler(event)"
fault="event.token.faultHandler(event)">

<mx:operation name="GetDataByGrouping" resultFormat="object">
<mx:request>
<GroupingRequests>
<GroupName>
RPRToolStaticData
</GroupName>
</GroupingRequests>
</mx:request>
</mx:operation>
</mx:WebService>

The equivalent in AS, if you're interested is:

var ws:WebService = new WebService();
ws.loadWSDL(xml_config.client_measures_[EMAIL PROTECTED] + "?WSDL");
ws.useProxy = false;
ws.addEventListener("result", onIndustryAndSizeIdsLoaded);
ws.addEventListener("fault", onIndustryAndSizeIdsFault);

var op:AbstractOperation;
op = ws['GetDataByGrouping'];

var args:Object = new Object;
args.groupingRequests = new Array();
args.groupingRequests.push({GroupName: "RPRToolStaticData"});

op.arguments = args;
op.send();

Thanks in advance,
Ben

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to