// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Web.Services; namespace test { public class IdColourPair { private int id; private string colour; public int Id { get { return id; } set { id = value; } } public string Colour { get { return colour; } set { colour = value; } } } public class WS1 : WebService { [WebMethod] public IdColourPair[] GetColours() { IdColourPair[] res = new IdColourPair[3]; res[0] = new IdColourPair(); res[0].Id = 11; res[0].Colour = "Red"; res[1] = new IdColourPair(); res[1].Id = 12; res[1].Colour = "Green"; res[2] = new IdColourPair(); res[2].Id = 13; res[2].Colour = "Blue"; return res; } } }