Error in accessing web service

Mac Vira posted at 11-May-08 01:47
I m getting error in accessing web service.

"Value of type1-dimensional array of object can not be converted to System.Collections.ArrayList"

Here is the Code of Web Service:

    <WebMethod()> _
    Public Function HelloWorld() As String
        Return "Hello World"
    End Function

    <WebMethod()> _
    Public Function GetForms() As ArrayList
        Dim aList As New ArrayList

        aList.Add("abc")
        aList.Add("abt")
        aList.Add("abg")
        aList.Add("abf")

        Return aList

    End Function
The HelloWorld method is working properly but other methos is not working.

Here is Windows App code for accessing service :

 Private Sub btnFind_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFind.Click
        Dim ws As New eu.qsh.vbmade2007.FullFormService

        Dim dt As New Object
        Dim tbl As New Data.DataTable
        Dim lst As New ArrayList


        lst = ws.GetForms


    End Sub

When i m trying to access the service i got the error
"Value of type1-dimensional array of object can not be converted to System.Collections.ArrayList"

I have tried typecasting by CTYPE but it failed.

I have not modified anything else in web service.

Pls help me in this matter.



Click here to sign in and reply. You could earn money via our $500 contest just for being helpful.
  Error in accessing web service - Mac Vira  11-May-08 01:47 1:47:40 AM
      check here - santhosh kapa  11-May-08 02:45 2:45:47 AM
          The Problem still exist - Mac Vira  12-May-08 09:18 9:18:58 AM
              ok, try.. - santhosh kapa  12-May-08 09:16 9:16:49 AM
      Solution - Aravind Kumar  11-May-08 11:56 11:56:45 PM
          Thnx - Mac Vira  12-May-08 09:18 9:18:20 AM
      Answer try this - Chirag Bhavsar  12-May-08 02:03 2:03:16 AM
          Thnx : Its working - Mac Vira  12-May-08 09:15 9:15:54 AM
      Try This One - Sujit Patil  12-May-08 02:49 2:49:27 AM
          Code not working - Mac Vira  12-May-08 09:03 9:03:05 AM
          Code not working - Mac Vira  12-May-08 09:16 9:16:56 AM
View Posts