using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
namespace TestWcf
{
/// <summary>
/// Summary description for WebService1
/// </summary>
[WebService(Namespace = "http://myFirstdummyanddirtynamespace.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class WebService1 : System.Web.Services.WebService
{
[WebMethod]
public List<MyMessageClass> HelloWorld(int nb)
{
List<MyMessageClass> responses = new List<MyMessageClass>();
for (int i = 0; i < nb; i++) {
MyMessageClass currentResponse = new MyMessageClass() { DataType= "MyType1", Id= i};
for (int j = 0; j < nb; j++)
{
currentResponse.Changes.Add("MyField" + j, "myValue" + j);
}
}
return responses;
}
}
public class MyMessageClass
{
public MyMessageClass() {
Changes = new Dictionary<string, string>();
}
public string DataType;
public int Id { get; set; }
public Dictionary<string, string> Changes { get; set; }
}
}
|