如何安装和证书HTTPRIO连接

时间:2013-12-03 19:14:04

标签: web-services delphi http

我导入WSDL文件。导入的WSDL文件中的GetCA就是函数。

以下运行程序时的代码块示例。

其中函数调用whoami在收到证书时尚未安装错误。如何安装和证书HTTPRIO连接?

begin
  HTTPRIO1.WSDLLocation := defWSDL;
  HTTPRIO1.Service := defSvc ;
  HTTPRIO1.Port := defPrt ;
  HTTPRIO1.URL := defURL;

  b := WhoAmIMessage.Create;
  a := ReplyMessage.Create;
  Cert := TElX509Certificate.Create(nil);

  try
    F := TFileStream.Create(CertFile, fmOpenRead or fmShareDenyWrite);
    CERT.LoadFromStreamPFX(f, CertPass);
    F.Position := 0;

    HTTPRIO1.HTTPWebNode.OnBeforePost := OnBeforePost;

    Trs := GetCA(True, ' ', HTTPRIO1);

    B := Trs.WhoAmI;
    ShowMessage(BoolToStr(B.IsAuthenticated));
  finally
    a.Free;
    b.Free;
    Cert.Free;
    FreeAndNil(F);
  end;
end;

0 个答案:

没有答案