In Cairngorm a Command creates a Delegate which fires off (e.g.) a 
WebService operation.  The way that's done in most Cairngorm examples 
is like this:

service = ServiceLocator.getInstance().getService('someWebService');
token = service.someWSMethod(someData);

This AS way of triggering the WebService passes an outgoing argument 
(someData) to the mx:operation, which sends it to the remote web 
service.

Problem is that in the Flex documentation, there are way more 
examples of using data binding inside an mx:operation to send those 
outgoing arguments...

<mx:WebService
   id="employeeWS"
   destination="wsDest"
   showBusyCursor="true"
   fault=Alert.show(event.fault.faultstring)">
   <mx:operation name="getList">
      <mx:request>
         <deptId>{someDataProvider.data}</deptId>
      </mx:request>
   </mx:operation>
</mx:WebService>

In Cairngorm, to use the data binding method I'd have to bind to data 
in the ModelLocator, so even if the argument's data isn't something 
I'm tracking or storing in ModelLocator I'll have to store it in 
there for the WebService data binding to work. That sounds junky. 
That means when someone clicks on a selected person (or whatever) 
I'll have to first store them in ModelLocator, fire off the 
WebService operation, then in my result handler clean that temp 
selected person out of ModelLocator.

But...

If I use the AS method of firing off a WebService (which appears to 
be the proper way) and just do token = service.someWSMethod(someData) 
and pass in (someData) I don't have to worry about all that temp 
ModelLocator stuff... but... there's very little documentation on how 
to pass data into an mx:operation using AS. Actually I think there's 
only two, and they're very simplistic.

I've gotten basic WebServices (with a single arg) to work the AS way, 
but what happens when I need to send multiple args to my remote web 
service? I know I can do token = service.someWSMethod(someData, 
otherData, evenMoreData) but how does the remote web service know 
which data maps to which args? Will the operation just process and 
send them in order, or are the variable names automatically changed 
into tags before calling the remote ws (e.g. someData is sent to the 
remote web service as <someData>someData's value</someData>)?

Is there any documentation or examples out there that deal with this 
on a slightly more complex level?  I just need to know how to call a 
WebService operation with multiple outgoing args, and to 
understand "the rules" behind passing args to WebService operations 
in AS. Anyone?

Thanks!
Darren






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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to