[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

Returning array from Asp.Net webservice via SOAP to classic Asp

Steve Kuhn

7/29/2003 3:51:00 PM

Hello everyone,

I have a web service written in C# which returns a array of strings. Now I
have a classic Asp site that needs to get that array (right now trying to
use SOAP). The webservice returns xml containing the array of strings, and
the classic asp understands how many elements are in the array (by using
UBound), but when I try to access an element of the array (by going
response.write( myArray(1) ) ), I get an "Type mismatch" error. What could I
possibly be doing wrong? Here is a sample of what I am doing:

WEBSERVICE:
[WebMethod(EnableSession=true)]
public string[] myWebMethod()
{
return myStringArray;
}

CLASSIC ASP:
Dim objSOAP
set objSOAP = CreateObject("MSSOAP.SoapClient30")
objSOAP.MSSoapInit("http://myIP.net/myWebService.asmx?...)

myArray = objSOAP.myWebMethod()
response.write( myArray(1) ) 'ERROR

Please let me know if you need any more info or clarification. Thanks for
your time and help!
Steve
2 Answers

Steve Kuhn

7/29/2003 7:33:00 PM

0

the ASP page states that the object returned is of type String(). However
when I try to access an element like myStringArray(1), a type mismatch error
occurs. Anyone have any ideas? Thanks

majiofpersia

7/29/2003 7:53:00 PM

0

I don't know that much about your situation, but I do know that
traditionally VB array and arrays in any other language have different type
definitions. So if you are creating your array in C# and trying to get it
as a VBScript array ... you get a type mismatch error.

That would be my guess, hope it helps,

- Maji


"Steve Kuhn" <kuhns85@mio.uwosh.edu> wrote in message
news:uVCWsggVDHA.2568@tk2msftngp13.phx.gbl...
> the ASP page states that the object returned is of type String(). However
> when I try to access an element like myStringArray(1), a type mismatch
error
> occurs. Anyone have any ideas? Thanks