If someone posts XML from an application to my ASP.NET page, how can I parse it and give the response back in XML format?
Sample client code posting XML to my URL:
WebRequest req = null;
WebResponse rsp = null;
string uri = "https://beta.abc.company.com/mypage.aspx";
req = WebRequest.Create(uri);
req.Method = "POST";
req.ContentType = "text/xml";
StreamWriter writer = new StreamWriter(req.GetRequestStream());
writer.WriteLine(txtXML.Text.ToString());
writer.Close();
rsp = req.GetResponse();
How could I parse XML from mypage.aspx
and give the response as XML?