我是 C# 新手,我不确定是否所有的细节都在这里。
最初,我应该发送一个 SOAP 请求并将其响应读入数据集。
以下代码有效:
DataSet ds = new DataSet();
cred.CredExecution mycredit = new cred.CredExecution();
ds = mycredit.RetrieveParsedRawData(inquiry, true);
// I have the Web Reference "cred" added to the project.
// Since I wasn't sure if a service reference was needed, I added that too.
现在响应格式已更改为 XML,我不知道如何阅读它。
我将代码更改如下:
System.Xml.XmlDocument XmlDoc = new System.Xml.XmlDocument();
cred.CredExecution mycredit = new cred.CredExecution();
XmlDoc = mycredit.RetrieveParsedRawData(inquiry, true);
但它失败并出现错误:
无法将类型“System.Xml.XmlElement”隐式转换为“System.Xml.XmlDocument”
我尝试使用:
System.Xml.XmlElement XmlEle = new System.Xml.XmlElement();
但系统未能说它受到保护。