IncludeTest.asmx 717 B

12345678910111213141516171819202122232425262728293031323334
  1. <%@ WebService Language="c#" Class="IncludeTest" %>
  2. using System;
  3. using System.Collections;
  4. using System.Xml.Serialization;
  5. using System.Web.Services;
  6. using System.Web.Services.Protocols;
  7. public class IncludeTest
  8. {
  9. [WebMethod]
  10. [XmlInclude(typeof(ComplexThing))]
  11. [SoapInclude(typeof(ComplexThing))]
  12. public ArrayList foo()
  13. {
  14. ArrayList list = new ArrayList();
  15. list.Add(new ComplexThing("abc", 1.1f));
  16. list.Add(new ComplexThing("xyz", 2.0f));
  17. return list;
  18. }
  19. }
  20. public class ComplexThing
  21. {
  22. public ComplexThing() {}
  23. public ComplexThing(string name, float val)
  24. {
  25. this.name = name;
  26. this.val = val;
  27. }
  28. public string name;
  29. public float val;
  30. }