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