469,883 Members | 1,241 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,883 developers. It's quick & easy.

Pass array via SOAP from asp page to dotnet webservice

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


Jul 22 '05 #1
1 3797
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


Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

15 posts views Thread by MR | last post: by
9 posts views Thread by MMesich | last post: by
6 posts views Thread by A.M-SG | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.