Hey Guys,
I’m having a small issue with submitting an object through an array to a web service in flash. I’ve submitted objects to a different web service before with no problems, and I’ve submitted the params that aren’t part of the object with no problems before, but I can’t seem to get the format right for submitting the object as part of an array (Important because eventually there will be multiple objects in that array).
My code is thus:
triggerWebService = function () {
trace("triggerWebService()");
var RMAItems:Array = new Array();
for (var i:Number = 0; i<=currPlus; i++) {
var RMAItem:Object = new Object();
//RMAItem.SoldItem = eval("mainContent.specs.product"+i).text;
//RMAItem.SerialNumber = eval("mainContent.specs.serial"+i).text;
RMAItem.SoldItem="Sold Item"
RMAItem.SerialNumber=123456
RMAItem.WarrantyNumber = 22222;
RMAItems.push([RMAItem]);
if (i == currPlus) {
this._parent.rmaSubmit_ws.params = [mainContent.specs.firstName.text, mainContent.specs.lastName.text, mainContent.specs.address1.text, mainContent.specs.address2.text, mainContent.specs.city.text, mainContent.specs.stateName.text, mainContent.specs.zip.text, mainContent.specs.country.text, mainContent.specs.phone.text, mainContent.specs.email.text, "BACK", "TEST guiID", mainContent.specs.summary.summary.text, RMAItems];
//trace(this._parent.rmaSubmit_ws.params)
this._parent.rmaSubmit_ws.trigger();
}
}
};
The web service is:
http://wsnew.sp.cm3consulting.com/smartparts.asmx?WSDL
and the method that is being called is:
AddRMAFromForm()
Be aware that there are a few methods with very similar names
And if you do any testing with submitting on the actual web service please populate the fields with definite “test” names as it goes to the actual database. If anyone can give me any help on the proper format or what I’m doing wrong, it would be greatly appreciated.
Here is the function that is called when results are received in the web service. The resulting RMA number should be a unique integer… Not “0”.
rmaResult = function (ev:Object):Void {
trace("Results received");
var rmaNum = ev.target.results.RMANumber;
trace(ev.target.results.ErrorDescription);
trace(ev.target.results.StackTrace);
trace(ev.code);
trace(rmaNum);
trace(ev.target.results.RMANumber);
}
thanks very much,
-iLan