SharpMap.Web.Wms.Client.GetRemoteXml C# (CSharp) 메소드

GetRemoteXml() 개인적인 메소드

Downloads servicedescription from WMS service
private GetRemoteXml ( string Url, System proxy ) : XmlDocument
Url string
proxy System
리턴 System.Xml.XmlDocument
        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);
            }
        }