4th post of the day… this is what happens when you’re anxiously waiting for news
So, when writing code for the Imagine Cup entry, I hit a brick wall trying to serialise an ArrayList of Structs over a Web Service. Here is the way that I found works best:
using System.Xml.Serialization;
public struct Device
{
public int id;
public string fname, room, type;
public bool is_controllable, status;
}
[WebMethod]
[XmlInclude(typeof(Device))]
public ArrayList GetDevices()
{
ArrayList devices = new ArrayList();
//Logic here
return devices;
}

The Web Services, ArrayLists and Structs, oh my! by Jed Laundry, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 New Zealand License.

