我曾试图利用从APICA中获取的数据,但我无法阅读XML的答复。
其形式如下:
<?xml version="1.0" standalone="no"?>
<SOAP-ENV:Envelope xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema" xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAPSDK4:GetStoreProductsResponse xmlns:SOAPSDK4="http://www.externalwebservice.com/message/">
<StoreProducts>
<StoreID></StoreID>
<Products></Products>
</StoreProducts>
</SOAPSDK4:GetStoreProductsResponse></SOAP-ENV:Body>
</SOAP-ENV:Envelope>
我所需要的是Products(现在)。
我正在尝试使用。 C# to parse a SOAP Response (and others to not Hum this) without results.
我的法典:
XDocument tst = XDocument.Load("Response.xml");
XNamespace xmlns = "http://schemas.xmlsoap.org/soap/envelope/";
var tstr = from result in tst.Descendants(xmlns + "StoreProducts") select result.Element("Products").Value;
I am almost sure that I am missing something basic.
任何术语都将得到真正的赞赏。
谢谢。