0
我有我得到返回給Web服務調用的響應XML提要:內嵌VB解析XML
<?xml version="1.0" encoding="utf-8"?>
<CustomerGetResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://WHATEVER/webservice">
<UserExists>false</UserExists>
<DisableAccountFlag>false</DisableAccountFlag>
</CustomerGetResult>
我採取的響應,並將其存儲爲一個名爲字符串:strRead。然後我試圖得到使用以下的值(沒有成功):
Dim XMLString = XDocument.Parse(strRead)
Response.Write("UserExists: " & XMLString.<CustomerGetResult>.<UserExists>.Value)
Response.Write("DisableAccountFlag: " & XMLString.<CustomerGetResult>.<DisableAccountFlag>.Value)
我也嘗試過其他方法都沒有成功:
Dim doc As New System.Xml.XmlDocument()
doc.LoadXML(strRead)
dim SymbolText as String = doc.SelectSingleNode("//CustomerGetResult/UserExists").Value
Response.Write(SymbolText)
誰能幫助我在這一點?這是內聯在一個aspx文件中。
您需要使用的命名空間。 – SLaks