0
我已经使用这个相同的代码为许多其他项目,并没有问题,但由于某种原因,它不会在这里工作。每当我到达“如果没有.selectSingleNode(strNode)没有什么”然后“它什么也没有回来,并把我放到其他地方。我已经能够验证下面列出的XML以及正在阅读的代码块。selectSingleNode失败与肥皂响应VB6
不幸的是,我必须在VB6中开发这个以维持与其他产品的兼容性。
的代码如下:
With objXMLResponse
Dim strNode As String
strNode = "//PingResponse/PingResult/ResultCode"
If Not .selectSingleNode(strNode) Is Nothing Then
If .selectSingleNode(strNode).Text = "Success" Then
MsgBox "We have succeded", vbOKOnly
Else
MsgBox "We have failed", vbOKOnly
End If
Else
MsgBox "We have failed", vbOKOnly
End If
End With
SOAP响应如下:提前为任何帮助,这
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PingResponse xmlns="http://avatax.avalara.com/services">
<PingResult>
<TransactionId>784293066</TransactionId>
<ResultCode>Success</ResultCode>
<Version>14.5.0.53</Version>
</PingResult>
</PingResponse>
</s:Body>
</s:Envelope>
感谢。