value of type '1-dimensional array of object' cannot be converted to 'system.collections.ArrayList'
-
Please I need help. I am writing a windows application and a web service application using VB.NET 2005. I have a web service method that can return an arraylist object. When I try to type the code that will call the web service method I get the following error message: (value of type '1-dimensional array of object' cannot be converted to 'system.collections.ArrayList') Please any one can help me and tell me how can I return an arraylist from a web service method and how can I consume the web service and be able to receive and convert the arraylist object back to my windows application? Web service Method Code: _ Public Function CustomersList() As ArrayList Dim _Result As New ArrayList Dim oInfo1 As New CustomerInfo oInfo1.CustomerNo = 1 oInfo1.CustomerName = "Customer1" _Result.Add(oInfo1) Dim oInfo2 As New CustomerInfo oInfo2.CustomerNo = 2 oInfo2.CustomerName = "Customer2" _Result.Add(oInfo2) Return _Result End Function The Call to the web service method in the Client side: Private Sub CallWebservice() Dim _Customer As New Customer.Customer _Customer.Url = "http://localhost:1968/Customer.asmx" Dim _Result As ArrayList 1- _Result = CType(_Customer.CustomersList, ArrayList) 2- _Result = _Customer.CustomersList End Sub Thank you.
-
Please I need help. I am writing a windows application and a web service application using VB.NET 2005. I have a web service method that can return an arraylist object. When I try to type the code that will call the web service method I get the following error message: (value of type '1-dimensional array of object' cannot be converted to 'system.collections.ArrayList') Please any one can help me and tell me how can I return an arraylist from a web service method and how can I consume the web service and be able to receive and convert the arraylist object back to my windows application? Web service Method Code: _ Public Function CustomersList() As ArrayList Dim _Result As New ArrayList Dim oInfo1 As New CustomerInfo oInfo1.CustomerNo = 1 oInfo1.CustomerName = "Customer1" _Result.Add(oInfo1) Dim oInfo2 As New CustomerInfo oInfo2.CustomerNo = 2 oInfo2.CustomerName = "Customer2" _Result.Add(oInfo2) Return _Result End Function The Call to the web service method in the Client side: Private Sub CallWebservice() Dim _Customer As New Customer.Customer _Customer.Url = "http://localhost:1968/Customer.asmx" Dim _Result As ArrayList 1- _Result = CType(_Customer.CustomersList, ArrayList) 2- _Result = _Customer.CustomersList End Sub Thank you.
I think you need Vista Home for that to work.
**
xacc.ide-0.2.0.57 - now with C# 2.0 parser and seamless VS2005 solution support!
**