Hello all,
new problem of the day. I want to pass a list of string names in from a web service to a client. I have tried using both an array of strings, an arraylist, and a collection - all to no success. My preference is to use an arraylist for the iteration and array manipulation methods already built in. Here is the error I get:
Additional information: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: The type System.Collections.ArrayList may not be used in this context.
On the service, I use the following code for testing.
Public Function GetManifest()
Dim tar As New ArrayList
m_mancounter = 0
tar.Add("test")
tar.Add("test2")
Return tar
End Function
the client code reads:
Public Sub GetAllFiles()
'Try
Console.WriteLine("processing manifest")
Dim availablefiles As Object
Dim proxy As myservice.servmethods = New myservice.servmethods
availablefiles = proxy.GetManifest
Console.WriteLine("filecount: " & availablefiles.Count.ToString)
If Not (availablefiles.Count = 0) Then
For Each i As String In availablefiles
Console.WriteLine("file: " & i)
Next
Else : Console.WriteLine("Array is Empty!")
End If
'Catch ex As Exception
'End Try
End Sub
I declare an object rather than an arraylist based on an article I read here from VBAhole... I think ;-)
Does anyone have any clue what I'm doing wrong or have any ideas on how I can send this info over without high bandwidth - i.e. no xml docs or class bojects?
thanx in advance
inzo
new problem of the day. I want to pass a list of string names in from a web service to a client. I have tried using both an array of strings, an arraylist, and a collection - all to no success. My preference is to use an arraylist for the iteration and array manipulation methods already built in. Here is the error I get:
Additional information: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: The type System.Collections.ArrayList may not be used in this context.
On the service, I use the following code for testing.
Public Function GetManifest()
Dim tar As New ArrayList
m_mancounter = 0
tar.Add("test")
tar.Add("test2")
Return tar
End Function
the client code reads:
Public Sub GetAllFiles()
'Try
Console.WriteLine("processing manifest")
Dim availablefiles As Object
Dim proxy As myservice.servmethods = New myservice.servmethods
availablefiles = proxy.GetManifest
Console.WriteLine("filecount: " & availablefiles.Count.ToString)
If Not (availablefiles.Count = 0) Then
For Each i As String In availablefiles
Console.WriteLine("file: " & i)
Next
Else : Console.WriteLine("Array is Empty!")
End If
'Catch ex As Exception
'End Try
End Sub
I declare an object rather than an arraylist based on an article I read here from VBAhole... I think ;-)
Does anyone have any clue what I'm doing wrong or have any ideas on how I can send this info over without high bandwidth - i.e. no xml docs or class bojects?
thanx in advance
inzo