[Flashcoders] WebService Class Help

2005-11-15 Thread Doug Coning
Greetings!

I'm trying to setup a WebService class to handle multiple operations.
Some operations will have many parameters, while others may have none.
However, I'm having problems figuring out how to pass either an array or
an object to the WebService class.  Below is an example that sends 2
strings.  How could I change the code below to pass an array containing
the two country strings and then pass that into the callback object?

import mx.services.WebService;
//  VARIABLES
var country1:String = USA;
var country2:String = Canada;

// WEB SERVICE
function WebCall(str1:String, str2:String){
var WSDL_URL:String =
http://www.xmethods.net/sd/2001/CurrencyExchangeService.wsdl;;
var wsExRate:WebService = new WebService(WSDL_URL);
var oCallback:Object = wsExRate.getRate(country1, country2);
oCallback.onResult = function(nRate):Void {
trace(Rate for  + country1 +  to  + country2 +  = 
+ nRate);
};
}
WebCall(country1, country2);


THANKS FOR ANY HELP!!!

Doug Coning 
Software Developer
FORUM Solutions, LLC
 
This e-mail and any attachment(s) are intended for the specified recipient(s) 
only and are legally protected.  If you have received this communication in 
error, please reply to sender's e-mail address with notification of the error 
and then destroy this message in all electronic and physical forms.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] WebService Class Help

2005-11-15 Thread Doug Coning
I found my own answer in using arguments to determine the amount of
parameters passed then setting up a switch statement to select the
correct call...

Doug Coning 
Software Developer
FORUM Solutions, LLC


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:flashcoders-
 [EMAIL PROTECTED] On Behalf Of Doug Coning
 Sent: Tuesday, November 15, 2005 10:21 AM
 To: Flashcoders mailing list
 Subject: [Flashcoders] WebService Class Help
 
 Greetings!
 
 I'm trying to setup a WebService class to handle multiple operations.
 Some operations will have many parameters, while others may have none.
 However, I'm having problems figuring out how to pass either an array
or
 an object to the WebService class.  Below is an example that sends 2
 strings.  How could I change the code below to pass an array
containing
 the two country strings and then pass that into the callback object?
 
 import mx.services.WebService;
 //  VARIABLES
 var country1:String = USA;
 var country2:String = Canada;
 
 // WEB SERVICE
 function WebCall(str1:String, str2:String){
   var WSDL_URL:String =
 http://www.xmethods.net/sd/2001/CurrencyExchangeService.wsdl;;
   var wsExRate:WebService = new WebService(WSDL_URL);
   var oCallback:Object = wsExRate.getRate(country1, country2);
   oCallback.onResult = function(nRate):Void {
   trace(Rate for  + country1 +  to  + country2 +  = 
 + nRate);
   };
 }
 WebCall(country1, country2);
 
 
 THANKS FOR ANY HELP!!!
 
 Doug Coning
 Software Developer
 FORUM Solutions, LLC
 
 This e-mail and any attachment(s) are intended for the specified
 recipient(s) only and are legally protected.  If you have received
this
 communication in error, please reply to sender's e-mail address with
 notification of the error and then destroy this message in all
electronic
 and physical forms.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
This e-mail and any attachment(s) are intended for the specified recipient(s) 
only and are legally protected.  If you have received this communication in 
error, please reply to sender's e-mail address with notification of the error 
and then destroy this message in all electronic and physical forms.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders