Hello all I am new at Flash-db abd really hoping that experts here can help me with a probelm I have.
I have a very simple C# .Net web service that has the following method
[WebMethod]
public string Test(out string p1, out string p2)
{
p1 = "test1";
p2 = "test2";
return "test3";
}
And I call it from the action script like follows: [in the 1st frame of my
test.fla I have following code]
stop();
import mx.services.*;
trace("Creating webservice");
var myWebServiceObject = new
WebService("
http://localhost/TestWebService/TestWebService.asmx?WSDL");
myWebServiceObject.onLoad = function (WSDLDocument)
{
trace("Wsdl load Complete");
var s1:String;
var s2:String;
trace("making the test call");
MyPendingCallObject = myWebServiceObject.Test(s1,s2);
MyPendingCallObject.onResult = function(result)
{
trace("Test call retunred successsfully"); // I see this trace
trace("result = "+result); // I see result = test3 which is return value of the webservice
trace(this.getOutputParameters().length); // displays "1"
}
}
myWebServiceObject.onFault = function (fault)
{
trace("Wsdl load fault");
}
My question is why is this.getOutputParameters().length is 1 ? I was expecting
it to be 3. How can I get the values of out paramters p1 and p2 ?
Accroding to the documentation I should have been able to retrive these values
using PendingCall.getOutputParameterByName() and PendingCall.getOutputParameter()
functions.
I saw an article at Flash-db here at flash-db by Jeffrey Hill. It comes close to what I want to do. Could Jeffery please tell me how the "results" in WebServices in flash shows up as a structure. For my web service it simply says results and when I try to access p1 and p2 as members it comes out as undefined.
Please someone help.
--Aalok.