合作伙伴写了一些处理逻辑在WebService中,wsdl地址为:https://114.255.245.64:8080/Crm/services/clienttrade?wsdl
  我用delphi新建一个WebService的WSDL Import,生成一个文件后,调用报错,谁能帮忙:
  调用:
  procedure TForm1.btn2Click(Sender: TObject);
var
  x: THTTPRIO;  InterfaceVariable: clienttradePortType;
begin
  X   :=THTTPRio.Create(Application);
  x.HTTPWebNode.UseUTF8InHeader:=true;
  x.WSDLLocation:= 'https://114.255.245.64:8080/Crm/services/clienttrade?wsdl';
  InterfaceVariable   :=   X   as   clienttradePortType;
  showmessage(InterfaceVariable.SayHello);
end;
报错信息有时是“证书作者不支持。。”、“Empty Document"
郁闷。另外,在WSDL Import导入的时候,点击Next有时会出现:
    Unable to load WSDL File/Location: https://114.255.245.64:8080/Crm/services/clienttrade?wsdl.  Error [灾难性故障].

解决方案 »

  1.   

    与C#通讯实现上传文件的webservice我有,java的没有。
      

  2.   

    WSDL Import不能生成,就自己写
    请参考,
    就这么调用GetOrlServicePortType.GetPorts()
    unit OrlWebService;interfaceuses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;type
      OrlServicePortType = interface(IInvokable)
      ['{76B1606E-9B05-4FE0-AD1E-55393C25E5BB}']
        function GetPorts(const userName: WideString; const password: WideString): WideString; stdcall;
      end;function GetOrlServicePortType(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): OrlServicePortType;implementationfunction GetOrlServicePortType(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): OrlServicePortType;
    const
      defWSDL = 'http://192.168.1.27:8080/axis2/services/OrlService?wsdl';
      defURL  = 'http://192.168.1.27:8080/axis2/services/OrlService';
      defSvc  = 'OrlService';
      defPrt  = 'OrlServicePortType';
    var
      RIO: THTTPRIO;
    begin
      Result := nil;
      if (Addr = '') then
      begin
        if UseWSDL then
          Addr := defWSDL
        else
          Addr := defURL;
      end;
      if HTTPRIO = nil then
      begin
        RIO := THTTPRIO.Create(nil);
      end
      else
        RIO := HTTPRIO;
      try    Result := (RIO as OrlServicePortType);
        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;initialization
      InvRegistry.RegisterInterface(TypeInfo(OrlServicePortType), 'http://service.nineOrl.com', 'UTF-8');
      InvRegistry.RegisterDefaultSOAPAction(TypeInfo(OrlServicePortType), '');
      InvRegistry.RegisterInvokeOptions(TypeInfo(OrlServicePortType), ioDocument);
    end.
      

  3.   

    樓上正解,這個wsdl確實需要加載ca憑證
      

  4.   

    可否设置信任所有凭证?我用的是Delphi7
      

  5.   

    不是导入CA就行的,要完全没有错误才行,包括域名和证书授予的用户名称一致,证书在有效期范围内,证书可信,楼主的url是直接用ip的,估计域名和证书授予的用户名称一致这一点就过不了。