我有这个肥皂响应,但我的代码没有读取 GetLatestReadingByMeterNoResult 孩子。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<GetLatestReadingByMeterNoResponse xmlns="http://www.multispeak.org/Version_3.0">
<GetLatestReadingByMeterNoResult objectID="112199498" utility="xxxxx">
<meterNo>112199498</meterNo>
<deviceID>112199498</deviceID>
<readingDate>2013-02-27T17:00:00.000Z</readingDate>
<posKWh>8406</posKWh>
<kW>15.508</kW>
<kWDateTime>2013-02-27T17:00:00.000Z</kWDateTime>
</GetLatestReadingByMeterNoResult>
</GetLatestReadingByMeterNoResponse>
</soapenv:Body>
</soapenv:Envelope>
代码:
XmlDocument resultXml = new XmlDocument();
XmlNamespaceManager mgr = new XmlNamespaceManager(resultXml.NameTable);
mgr.AddNamespace("soapenv", "http://schemas.xmlsoap.org/soap/envelope/");
mgr.AddNamespace("", "http://www.multispeak.org/Version_3.0");
resultXml.LoadXml(soapResult);
XmlNodeList nodeList = resultXml.SelectNodes("//GetLatestReadingByMeterNoResult", mgr);
nodeList 不返回任何节点