将XmlDocument加载到Webform控件中

时间:2015-04-10 08:49:11

标签: c# xml winforms wcf webforms

我创建了一个WCF服务,它使用提供的值发送短信。然后在字符串变量中返回XML。我已经设法将字符串加载到XmlDocument中,但是当我尝试将其加载到Webform控件上时,我得到一个错误,因为XmlDocument在内存中并且没有物理路径。如何将其加载到我的webform控件(WB_XMLOut)中。请参阅下面我的代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using LeadProcessTest.LeadProcessor;
using System.Xml;

namespace LeadProcessTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void BT_Process_Click(object sender, EventArgs e)
        {
            LeadProcessorClient LP = new LeadProcessorClient();

            string UName = Convert.ToBase64String(Encoding.UTF8.GetBytes(TB_UName.Text));
            string PWord = Convert.ToBase64String(Encoding.UTF8.GetBytes(TB_Pass.Text));
            string XMLIn = Convert.ToBase64String(Encoding.UTF8.GetBytes(TB_XMLin.Text));

            LP.Open();
            string Result = LP.Lead_Processing(UName, PWord, XMLIn);
            LP.Close();
            XmlDocument XML = new XmlDocument();
            XML.LoadXml(Result);

            WB_XMLOut.Url = new Uri(XML);

        }
    }
}

0 个答案:

没有答案