op.send([args]) turns into an Array holding an Array holding args
because the ... syntax in AS method signatures mean a variable number
of arguments passed to the method stored as an array.
So, the functional equivalent might be something like this:
op.send(EnterpriseId, DocumentType, ContainersToRetrieve,
MetadataToRetrieve);
Because you're no longer relying on the name of the args but rather the
order they're declared... though note this approach won't work until
Beta 3 for some styles of WSDL such as document literal.
Pete
-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of ben.clinkinbeard
Sent: Tuesday, April 18, 2006 9:42 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: mx.rpc.soap.mxml.WebService VS
mx.rpc.soap.WebService
Hi Peter, thanks again for the response. I apologize, but I am still a
bit confused. Are you saying that op.send([args]) would not work either,
and/or that it must be an array of primitives like strings and numbers?
I am alright with using the arguments property so I won't bother sending
you files but I certainly appreciate the offer.
I think perhaps these issues could use some clarification in the
documentation (I realize that is probably low priority at this point),
because when I read it (a few times) I got the impression that the two
ways of sending arguments were functionally equivalent.
Thanks again,
Ben
--- In flexcoders@yahoogroups.com, Peter Farland [EMAIL PROTECTED] wrote:
Operation.send(args) has the method signature:
override public function send(... args : Array) : AsyncToken
So the ... args:Array param will be an Array of length 1 with an
Object as _your_ args var. This means you can only send ordered
arguments via send(). For named arguments, you use the special
arguments property.
The only special case to this is if _your_ args was an XMLNode for
literal request envelope body content and it was the only thing passed
to Operation.send() then it would be unwrapped out of the args Array.
Also note there are known issues with passing ordered arguments (i.e.
an
Array) to document literal styled web services in beta 2 which should
be fixed in beta 3. If you have a .wsdl file and a sample .mxml file
you can send them to me directly offlist so that I can check they'll
work in beta 3.
-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of ben.clinkinbeard
Sent: Tuesday, April 18, 2006 4:58 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: mx.rpc.soap.mxml.WebService VS
mx.rpc.soap.WebService
Very cool. Thanks to both and Tim and Peter for your help.
Not sure if I should start a new thread for this (if i should just let
me know), but I am noticing some odd behavior when using
mx.rpc.soap.WebService. When I try passing an arguments object in the
send() method I am getting a fault with the following message: Array
of input arguments did not contain a required parameter at position 1.
When I assign the same object to the arguments property of my
AbstractOperation, everything works fine. Here is my code:
dmws = new WebService();
dmws.loadWSDL(Application.application.xml_config.document_metadata_url
.@
value
+ ?WSDL);
dmws.useProxy = false;
dmws.addEventListener(result,
onDmwsResult); dmws.addEventListener(fault, doFault);
var op:AbstractOperation;
op = dmws['GetDocument'];
var args:Object = new Object();
args.EnterpriseId = event.target.selectedItem.EnterpriseId;
args.DocumentType = EBD;
args.ContainersToRetrieve = new Array();
args.ContainersToRetrieve.push(Client);
args.ContainersToRetrieve.push(IndustryTrends);
args.ContainersToRetrieve.push(Fiduciary);
args.MetadataToRetrieve = new Array(DocumentHistory);
// this works
op.arguments = args;
op.send();
// this does not work
op.send(args);
Thanks,
Ben
--- In flexcoders@yahoogroups.com, ben.clinkinbeard
ben.clinkinbeard@ wrote:
Why are these separate classes? More importantly, why does the mxml
version have capabilities that its super class does not? I like the
showBusyCursor functionality, but prefer to code in AS when
possible.
Am I correct in assuming that these two things are mutually
exclusive?
Thanks,
Ben
--
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: