private void btnTestWFS_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; string url = txtWFSUrl.Text.Trim(); if (!String.IsNullOrEmpty(txtServiceName.Text.Trim())) { url = WebFunctions.AppendParametersToUrl(url, "ServiceName=" + txtServiceName.Text.Trim()); } string param = "REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WFS"; url = WebFunctions.AppendParametersToUrl(url, param); string capabilities = WebFunctions.RemoveDOCTYPE(WebFunctions.DownloadXml(url)); XmlDocument doc = new XmlDocument(); doc.LoadXml(capabilities); xmlViewTree1.XmlDocument = doc; } catch (Exception ex) { this.Cursor = Cursors.Default; MessageBox.Show("ERROR: " + ex.Message); } finally { this.Cursor = Cursors.Default; } }