Hi,
My requirement is that I will have SOAP data in XML.I will read from the file, and then send request to a webservice.Then, I need to write the response to a file. I am using vs 2005.
XmlDocument doc = new XmlDocument();
doc.Load(@"path to xml file");
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://www.w3schools.com/webservices/tempconvert.asmx");
req.Headers.Add("SOAPAction", "\"\"");
req.ContentType = "text/xml;charset=\"utf-8\"";
req.Accept = "text/xml";
req.Method = "POST";
Stream stm = req.GetRequestStream();
doc.Save(stm);
stm.Close();
WebResponse resp = req.GetResponse();
stm = resp.GetResponseStream();
StreamReader r = new StreamReader(stm);
Console.WriteLine(r.ReadToEnd());