J
JDeats
I've noticed what appears to be a bug in the Visual Studio.NET (1.0
and 2003 versions). If I declare a web method like so:
[WebMethod]
public ArrayList GetMyList()
{
ArrayList list = new ArrayList()
list.Add("one");
list.Add("two");
return list;
}
If I bind to the above from a client application like so:
ArrayList newlist = mywebservice.GetMyList();
The above fails (sometimes, sometimes it works), the compiler expects
a type of object[] (object array) and not ArrayList. Casting also
fails. I've even tried the following:
[WebMethod]
public object[] GetMyList()
{
ArrayList list = new ArrayList()
list.Add("one");
list.Add("two");
return list.ToArray();
}
Sometimes it works, sometimes it doesn't work. The later example never
works. Can anyone explain this? Is it a IDE generated code bug?
and 2003 versions). If I declare a web method like so:
[WebMethod]
public ArrayList GetMyList()
{
ArrayList list = new ArrayList()
list.Add("one");
list.Add("two");
return list;
}
If I bind to the above from a client application like so:
ArrayList newlist = mywebservice.GetMyList();
The above fails (sometimes, sometimes it works), the compiler expects
a type of object[] (object array) and not ArrayList. Casting also
fails. I've even tried the following:
[WebMethod]
public object[] GetMyList()
{
ArrayList list = new ArrayList()
list.Add("one");
list.Add("two");
return list.ToArray();
}
Sometimes it works, sometimes it doesn't work. The later example never
works. Can anyone explain this? Is it a IDE generated code bug?