Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 无法将SOAP请求的XML解析为数据集_C#_Xml_Web Services_Soap - Fatal编程技术网

C# 无法将SOAP请求的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

我正忙于编写一个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: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);