【发布时间】:2011-05-11 12:29:18
【问题描述】:
我有一个在 Delphi 2009 上编写的程序。它使用 SOAP over HTTP over SSL。因此,触发 HTTP 请求的是 SOAP 请求,该请求由 Microsoft Internet Explorer 通过 DLL 处理。 MSIE 然后会弹出一个要求登录的窗口。
但是现在我需要在 Delphi XE 中编译它,我遇到了问题。程序不想登录 SSL。根本没有弹出窗口。所以,触发器似乎不想工作。
错误出现在这段代码的第二行:
mantis:=GetMantisConnectPortType(false, mantisurl);
mi := mantis.mc_issue_get(username,password,MantisIssue);
错误是
Project IssueReporter.exe raised exception class ESOAPHTTPException with message 'Authorization Required (401) - 'https://***/mantis/api/soap/mantisconnect.php''.
列出的连接程序是
function GetMantisConnectPortType(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): MantisConnectPortType;
const
defWSDL = 'https://***/mantis/api/soap/mantisconnect.php?wsdl';
defURL = 'https://***/mantis/api/soap/mantisconnect.php';
defSvc = 'MantisConnect';
defPrt = 'MantisConnectPort';
var
RIO: THTTPRIO;
begin
Result := nil;
if (Addr = '') then
begin
if UseWSDL then
Addr := defWSDL
else
Addr := defURL;
end;
if HTTPRIO = nil then
RIO := THTTPRIO.Create(nil)
else
RIO := HTTPRIO;
try
Result := (RIO as MantisConnectPortType);
if UseWSDL then
begin
RIO.WSDLLocation := Addr;
RIO.Service := defSvc;
RIO.Port := defPrt;
end else
RIO.URL := Addr;
finally
if (Result = nil) and (HTTPRIO = nil) then
RIO.Free;
end;
end;
mc_issue_get 是
的一部分MantisConnectPortType = interface(IInvokable)
有声明:
function mc_issue_get(const username: string; const password: string; const issue_id: Int64): IssueData; stdcall;
在浏览器和 2009 年编译的旧 exe 中一切正常。请帮助解决这个问题。 基辅塔拉斯
【问题讨论】:
-
检查您的证书应该在哪里......并向我们展示客户获取证书的代码。
标签: delphi soap ssl https wsdl