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

S

Steve Kuhn

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?wsdl")

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
 
S

Steve Kuhn

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
 
M

majiofpersia

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top