I am creating a one service for Inserting(POST) data,
using this service client enter the data after that call service method to store that data in file (XML or JSON) in system
public void Add(Employee newEmployee) { XDocument doc = XDocument.Load(HttpContext.Current.Server.MapPath("StudentDB.xml")); doc.Element("Employees").Add( Department de=new Department(); doc.Element("Employees").Add( new XElement("Employee", new XElement("EmpId",newEmployee.EmpNo), new XElement("EmpName",newEmployee.EmpName), new XElement("DeptName",newEmployee.DeptName), new XElement("Department", new XElement("DeptNo", de.DeptNo), new XElement("Dname", de.Dname), new XElement("Location", de.Location) ))); doc.Save(HttpContext.Current.Server.MapPath("StudentDB.xml")); }
that web service post method
i am making client to call insert
when i call it, can you take that data and write to a file and save in to file folder any where in system
How can i do this?
The above code is correct ?
I want output like this
anilbabu