XML : To update exsisting XML and save it with Post method

I am reterving information of Guests in XML format via Get Request. How we can update exsisting XML and save it with Post method.Can please anyone assist me? We are trying to creating a STUB of web service.

  //Code in Home Controller     public HomeController()          {              this.guestRegistration = new guestRegistration();          }            /// <summary>          /// Retrieves the registartions.          /// </summary>          /// <returns></returns>          [HttpGet]          public HttpResponseMessage Get()          {              return this.guestRegistration.RetrieveGuests();          }  // Code in GuestRegistration.cs     public class GuestRegistration : CommonService      {          private const string RegistartionDataPath = "~/Docs/Registartion.xml";            public HttpResponseMessage RetrieveGuests()          {                var doc = XDocument.Load(HttpContext.Current.Server.MapPath(RegistartionDataPath));              return new HttpResponseMessage              {                  Content = new StringContent(doc.ToString(), Encoding.UTF8, "application/xml")              };          }    }    

No comments:

Post a Comment