Pass array via SOAP from asp page to dotnet webservice

Discussion in 'ASP General' started by Jon Maz, Jun 2, 2005.

  1. Jon Maz

    Jon Maz Guest

    Hi,

    I am trying to pass an array from an asp page (JScript) to a dotnet web
    service using the SOAP Toolkit 3.0. This is still at the Hello World stage,
    as you can see:

    WEB SERVICE METHOD

    [WebMethod]
    public string AcceptArray(object[] parameters)
    {
    return "no error!!!";
    }

    Can anyone post a very simple, working example of how the .asp page can pass
    the array? Below you can see as far as I got, and the error message I'm
    getting:

    ASP PAGE

    <%@ Language="JScript" %>
    <%
    var mySoapClient = Server.CreateObject("MSSOAP.SoapClient30");
    mySoapClient.ClientProperty("ServerHTTPRequest") = true;

    var myArray = new Array(0);
    myArray[0] = "hallo";

    mySoapClient.MSSoapInit("http://mywebservice/test.asmx?wsdl");
    var answer = mySoapClient.AcceptArray(myArray);

    Response.Write(answer);

    //tidy up
    mySoapClient = null;
    %>

    ERROR MESSAGE

    Error Type: Client (0x80020005)
    Client:Type conversion failure for element parameters
    HRESULT=0x80020005:
    Type mismatch. - Client:Unspecified client error.
    HRESULT=0x80020005:

    TIA

    JON
     
    Jon Maz, Jun 2, 2005
    #1
    1. Advertising

  2. Jon Maz

    Jon Maz Guest

    Hi All,

    Well, some progress. Have defeated the evil error message, but don't quite
    understand how/why:

    ASP PAGE
    <%@ Language="JScript" %>
    <%
    var mySoapClient = Server.CreateObject("MSSOAP.SoapClient30");
    mySoapClient.ClientProperty("ServerHTTPRequest") = true;

    var myArray = new Array(0);
    myArray[0] = "hallo";
    myArray[1] = "goodbye";

    var myArrayTwo = new Array(0);
    myArrayTwo[0] = "nuts";
    myArrayTwo[1] = "squirrel";

    mySoapClient.MSSoapInit("http://mywebservice/test.asmx?wsdl");
    var answer = mySoapClient.AcceptArray(myArray, myArrayTwo);
    Response.Write(answer);

    //tidy up
    mySoapClient = null;
    %>

    WEB SERVICE
    [WebMethod]
    public string AcceptArray(string myArray, string myArrayTwo)
    {
    return myArray + " ????? " + myArrayTwo;
    }


    and I get this:

    hallo,goodbye ????? nuts,squirrel

    In other words, the classic asp array is being converted (god knows where)
    into a comma-delimited string!

    Can anyone explain??

    TIA,

    JON
     
    Jon Maz, Jun 6, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles A. Lackman
    Replies:
    1
    Views:
    1,362
    smith
    Dec 8, 2004
  2. SpamProof
    Replies:
    0
    Views:
    575
    SpamProof
    Oct 21, 2003
  3. Steve Kuhn
    Replies:
    2
    Views:
    354
    majiofpersia
    Jul 29, 2003
  4. Jon Maz

    Pass array via SOAP from asp page to dotnet webservice

    Jon Maz, Jun 2, 2005, in forum: ASP .Net Web Services
    Replies:
    5
    Views:
    361
    Jon Maz
    Jun 6, 2005
  5. jean-françois labbe
    Replies:
    0
    Views:
    143
    jean-françois labbe
    May 13, 2006
Loading...

Share This Page