gpt4 book ai didi

vb.net - MSXML "The system cannot locate the resource specified"

转载 作者:行者123 更新时间:2023-12-04 10:57:57 31 4
gpt4 key购买 nike

我有一个函数,它使用 MSXML 发布一个 XML 文档,尽管没有对代码进行任何更改,但昨天该文档开始失败。功能如下:

Public Function PostFile(ByVal address As String, ByVal data As Byte()) As xmldocument
Dim xmlHTTP As New MSXML2.XMLHTTP
Dim response As New XmlDocument

Dim xmlDoc As New MSXML2.DOMDocument

Try
xmlDoc.load(data)
xmlHTTP.open("post", address, False)
xmlHTTP.send(xmlDoc)

If xmlHTTP.responseXML.xml <> String.Empty Then
response.LoadXml(xmlHTTP.responseXML.xml)
Return response
Else
Dim result As String = "<NO_Response><Error>the post succeeded to " + address + " but there was no responce returned</Error><Hint>Check FireWall Settings</Hint></NO_Response>"
response.loadxml(result)
Return response
End If

Catch ex As Exception
'Error logging code removed

End Try
Return Nothing
End Function

XML 文档和传入的地址都是正确的 - 导致错误的行是 xmlHTTP.send(xmlDoc) .我已经在 2 台不同的机器上尝试过,每次都出现相同的错误,也尝试过重新安装 MSXML3,但没有成功。

抛出的异常是:
InnerException: Nothing 
Message: "The system cannot locate the resource specified. "
Source: "msxml3.dll"
StackTrace: " at MSXML2.XMLHTTPClass.send(Object varBody) at comms.HTTPHandler.PostFile(String address, Byte[] data) in D:\SCC\Main\Sender\Http.vb:line 42"

最佳答案

结果证明是网络问题 - 我一开始并没有怀疑这一点,因为错误出现得如此之快,这并没有表明端点存在问题。问题在于已添加(不要问为什么)到防火墙的规则阻止了与目标地址的通信。

关于vb.net - MSXML "The system cannot locate the resource specified",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4041687/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com