NotificationsService.asmx.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Services;
  6. namespace NotificationRegistrationService
  7. {
  8. /// <summary>
  9. /// Summary description for Service1
  10. /// </summary>
  11. [WebService(Namespace = "http://notificationtest.linkdev.com/")]
  12. [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  13. [System.ComponentModel.ToolboxItem(false)]
  14. // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
  15. // [System.Web.Script.Services.ScriptService]
  16. public class NotificationsService : System.Web.Services.WebService
  17. {
  18. /// <summary>
  19. /// Adds the notification ID
  20. /// </summary>
  21. /// <param name="nid">The notification id.</param>
  22. /// <param name="sid">The service id.</param>
  23. [WebMethod]
  24. public void addnid(string nid, string sid)
  25. {
  26. System.IO.StreamWriter streamWriter = new System.IO.StreamWriter(Server.MapPath("NotificationRegistrations.txt"));
  27. // Do something more useful with them, like store them in a database after you check they don't exist
  28. streamWriter.WriteLine("**********************************");
  29. streamWriter.WriteLine(DateTime.Now.ToString());
  30. streamWriter.WriteLine("Notification id: " + nid);
  31. streamWriter.WriteLine("Service id: " + sid);
  32. streamWriter.WriteLine("**********************************");
  33. streamWriter.Close();
  34. }
  35. }
  36. }