I have a very simple C# .Net web service that has the following method
[WebMethod]
public string Test(out string p1, out string p2)
{
Result aResultL = new Result();
p1 = "test1";
p2 = "test2";
return "test3";
}
And I call it from the action script liek 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.
Can someone at Macromedia help me with this ? It is strange that I did not
find any questions of this effect on yoru forum or even entire goolge. Am I the
only one who is realy trying to use web serivices with flash ? Why woudl sucha
simple thing not work accourding to the documentation ?
Please someone help.
--Aalok.