Delphi soap https authentication failure pops up a dialog box

℡╲_俬逩灬. 提交于 2019-12-04 06:16:55

Replace WinINet by WinHTTP component. Both have very close APIs, and the 2nd does not create any UI interaction, but will return error codes, just like any other API. The UI part of WinINet may be a good idea for some software, but it sounds like if does not fit your needs.

See http://msdn.microsoft.com/en-us/library/windows/desktop/aa384068(v=vs.85).aspx

Of course, HTTPS and authentication will be handled in a similar manner. But you'll have to prompt for the user name and password, and update the HTTP headers as requested. See this link.

From our tests, WinHTTP is much faster than WinINet (certainly because it does not implement any UI part, and is not linked to Internet Explorer libraries).

You can take a look at our Open Source classes to guess how small is the difference in the API between WinINet and WinHTTP (most code is shared in the linked unit).

Try modifying SOAPHTTPTrans to handle the error silently. In THTTPReqResp.HandleWinInetError, there is ultimately a call to the error dialog:

  Result := CallInternetErrorDlg

You can probably detect your particular error, you should be able to return a 0 from HandleWinInetError, or at least NOT make a call to CallInternetErrorDlg. See if that helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!