我們有一些代碼可以連接到PayPal的PayFlowPro來更新定期結算訂閱中使用的信用卡。這段代碼過去在.Net 2應用程序池中工作得很好,但是當我們將它遷移到4.0時,它非常敏感 - 有時可以工作,而其他時候則不會。代碼看起來很直接,所以我不確定問題是什麼。PayPal PayFlowPro COMException 0x8000000A
的錯誤是:System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Runtime.InteropServices.COMException (0x8000000A): The data necessary to complete this operation is not yet available.
的代碼,間斷性地失效(但用於將舊服務器上的工作)的塊是:
Try
objWinHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
objWinHttp.Open("POST", GatewayHost, False)
objWinHttp.setRequestHeader("Content-Type", "text/namevalue") ' for XML, use text/xml
objWinHttp.SetRequestHeader("X-VPS-Timeout", "90")
objWinHttp.SetRequestHeader("X-VPS-Request-ID", requestID)
objWinHttp.Send(parmList)
Catch exc As Exception
End Try
' Get the text of the response. (DIES ON LINE BELOW)
transaction_response = objWinHttp.ResponseText
混亂的部分是間歇工作這始終是最難調試。這已經存在多年了,唯一的區別是我們的應用程序池現在運行在.Net 4和.Net 2.0之下,但我不認爲這會是一個問題。我將其翻轉回2.0,現在它的工作完美無瑕。
任何猜測從哪裏開始尋找? WinHttp.WinHttpRequest.5.1在.Net 4中有問題嗎?舊的服務器是2008 R2,新的服務器是2012 R1,所以也許這也是它的一部分?
更新 - 更改爲2.0仍然沒有解決它。它正在工作,然後再次停止。這沒有任何意義。