private XmlDocument GetRemoteXml(string Url, System.Net.WebProxy proxy)
{
try
{
System.Net.WebRequest myRequest = System.Net.WebRequest.Create(Url);
if (proxy != null) myRequest.Proxy = proxy;
System.Net.WebResponse myResponse = myRequest.GetResponse();
System.IO.Stream stream = myResponse.GetResponseStream();
XmlTextReader r = new XmlTextReader(Url, stream);
XmlDocument doc = new XmlDocument();
doc.Load(r);
stream.Close();
nsmgr = new XmlNamespaceManager(doc.NameTable);
return doc;
}
catch (System.Exception ex)
{
throw new ApplicationException("Could now download capabilities", ex);
}
}