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