Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / July 2003

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve Kuhn - 29 Jul 2003 16:51 GMT
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
Steve Kuhn - 29 Jul 2003 20:32 GMT
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 - 29 Jul 2003 20:52 GMT
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

> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.