我的职能是利用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)
。 我在两台不同的机器上尝试了这台机器,每台都有同样的错误,并且还尝试转录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:SCCMainSenderHttp.vb:line 42"