darylbewise
Programmer
Hi All,
I have the following code that sends a soap request to a web service and receives a soap response back,
What is the best way to actually process the soap response? e.g. should I be tryingto convert the streadreader into an xmldocument and process that way?
I have the following code that sends a soap request to a web service and receives a soap response back,
Code:
void HttpSOAPRequest(String xmlfile, string proxy)
{
XmlDocument doc = new XmlDocument();
doc.Load(Server.MapPath(xmlfile));
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("[URL unfurl="true"]http://api.affiliatewindow.com/v3/AffiliateService");[/URL]
if (proxy != null) req.Proxy = new WebProxy(proxy, true);
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);
}
What is the best way to actually process the soap response? e.g. should I be tryingto convert the streadreader into an xmldocument and process that way?