我正在使用此代码从 XE.COM 读取 XML 数据
string url = ConfigurationManager.AppSettings[CONFIGURATION_KEY_XE_COM_URL];
System.Xml.Serialization.XmlSerializer ser =
new System.Xml.Serialization.XmlSerializer(typeof(xedatafeed));
// try XmlReader
XmlReaderSettings settings = new XmlReaderSettings();
settings.XmlResolver = null;
settings.DtdProcessing = DtdProcessing.Parse;
System.Xml.XmlReader reader = System.Xml.XmlReader.Create(url, settings);
string reply = (string)ser.Deserialize(reader);
// try WebClient
System.Net.WebClient client = new System.Net.WebClient();
string data = Encoding.UTF8.GetString(client.DownloadData(url));
问题是这条线
xedatafeed reply = (string)ser.Deserialize(xedatafeed);
正在抛出异常
<xe-datafeed xmlns=''> was not expected.
我该如何解决?