C# 无法将SOAP请求的XML解析为数据集
我正忙于编写一个Web服务,它将接受最多5个表的SOAP请求 这是我提出的一个有效的SOAP请求,但为了简单起见,我删除了4个XML表C# 无法将SOAP请求的XML解析为数据集,c#,xml,web-services,soap,C#,Xml,Web Services,Soap,我正忙于编写一个Web服务,它将接受最多5个表的SOAP请求 这是我提出的一个有效的SOAP请求,但为了简单起见,我删除了4个XML表 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <soapenv:Header/> <soapenv:Body> <tem:Ec
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:EchoSoapRequest1>
<Route>
<Routecode>200906230000</RouteCode>
<Date>23/06/2009</Date>
<type>1</type>
<Depot_Code>'hh'</Depot_Code>
</Route>
</tem:EchoSoapRequest1>
</soapenv:Body>
</soapenv:Envelope>
我想出来了:)
var xmlPayload = xmlSoapRequest.SelectSingleNode("//Route");
DataSet ds = new DataSet();
ds.ReadXml(xmlPayload.innerxml);
var xmlPayload = xmlSoapRequest.SelectSingleNode("//Route");
DataSet ds = new DataSet();
XmlDocument xmldoc = new XmlDocument();
xmldoc.LoadXml(xmlPayload.OuterXml);
XmlNodeReader xmlread = new XmlNodeReader(xmldoc);
ds.ReadXml(xmlread);