using System; using System.Web; using System.Collections; using System.Web.Services; using System.Web.Services.Protocols; /// /// Summary description for myService /// [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class myService : System.Web.Services.WebService { public myService () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string HelloWorld() { return "Hello World"; } [WebMethod] public string DoWork() { //This is just a simple web service to demonstrate asynchronous calls. // You could replace this logic with code that calls out to a third party. string strStart = DateTime.Now.ToString() + ", " + DateTime.Now.Millisecond.ToString() + " milliseconds "; // Sleep for a full second System.Threading.Thread.Sleep(1000); return "Web Service: DoWork started on thread " + System.Threading.Thread.CurrentThread.ManagedThreadId + " at " + strStart + " and ended at " + DateTime.Now.ToString() + ", " + DateTime.Now.Millisecond.ToString() + " milliseconds "; } }