Returning multiple parameters from .Net Webservic

Ask a Question related to Macromedia Flash Actionscript, Design and Development.

  1. #1

    Default Returning multiple parameters from .Net Webservic

    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.


    Aalok Guest

  2. Similar Questions and Discussions

    1. Searching with multiple search parameters PHP
      I am attempting to build a multiple parameter search/result page in dreamweaver using php. I have been following along in the tutorial up until the...
    2. ASP - Multiple URL Parameters ?? Howto
      Using DWMX and ASP, how can I take advantage of multiple URL parameters? For example, I'd like to pass both the month and day as:...
    3. #23682 [Fbk->NoF]: sybase_query and multiple result sets: not returning first row set
      ID: 23682 Updated by: sniper@php.net Reported By: uk at dataway dot ch -Status: Feedback +Status: No...
    4. #23682 [Opn->Fbk]: sybase_query and multiple result sets: not returning first row set
      ID: 23682 Updated by: sniper@php.net Reported By: uk at dataway dot ch -Status: Open +Status: ...
    5. Multiple Parameters With Hyperlink in DataGrid
      I have a datagrid with a hyperlinkcontrol column. And it will only take one parameter. So I created a template column, with a hyperlink based on an...
  3. #2

    Default Re: Returning multiple parameters from .Net Webservic

    I am sorry I had an additional line in the webservice code I pasted in my last
    post, here is the code again.

    [WebMethod]
    public string Test(out string p1, out string p2)
    {
    p1 = "test1";
    p2 = "test2";
    return "test3";
    }

    Please someone give me answer to this.

    Thank you,
    --Aalok

    Aalok Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139