各位大侠,我用dll封装了wsdl的接口,结果在isapi中用loadlibrary不能装载动态库,不知道什么原因,请帮忙啊

解决方案 »

  1.   

    unit CAOperator;interface uses SysUtils,Classes,XMLDoc,ActiveX,SqlExpr,DBXpress,Forms, {FMTBcd,} DB,SoapHTTPClient,Variants,
          uSMSInterface;type
      TCAFunction = class
      private
        { Private declarations }
        FDBConnect: TSQLConnection;
        soapPRIO: THTTPRIO;
        FSoapCAIntf:SMSInterface;
      public
        { Public declarations }
        constructor Create;
        destructor Destroy;override;
        function Call(strRequest: String;limit:integer = -1):string;   end;    function NextTransID(DBConnect:TSQLConnection):string;implementation
       uses tools,SysParam;   function MD5( szData:string;
                     wLength:WORD;       //  cdecl;  stdcall
                     szBuffer:PChar )
                 : Boolean; cdecl;external 'NTPWDENC.DLL' name 'MessageDigest5';   Resourcestring strXMLHead = '<?xml version="1.0" encoding="GB2312"?>';
       
       const TransIDLengen:integer = 8;
    { TCAFunction }constructor TCAFunction.Create;
    begin
       CoInitialize(nil);
       FDBConnect:=nil;
       soapPRIO:= THTTPRIO.Create(nil);
       soapPRIO.URL:=SysParams.CAIntf.IntfUrl;
       FSoapCAIntf:=(soapPRIO as SMSInterface);
    end;destructor TCAFunction.Destroy;
    begin
      FSoapCAIntf:=nil;
      soapPRIO := nil;
      CoUnInitialize();
      inherited;
    end;
    function TCAFunction.Call(strRequest: String;limit:integer = -1):string;
    type
      TBuffer = array[0..1024] of char;
    var
      strSRequest : string;
      strBuffer   : TBuffer;
      sid : String;
    begin
      LogByDay(strRequest);
      if SysParams.CAIntf.IntfMode = 0 then
      begin
        strSRequest := strRequest+SysParams.CAIntf.SMSCode;
        FillChar(strBuffer,SizeOf(strBuffer),#0);
        if MD5(strSRequest,length(strSRequest),@strBuffer[0]) then
        begin
           strSRequest := LowerCase(strBuffer)+SysParams.CAIntf.SMSKey;
          MD5(strSRequest,length(strSRequest),@strBuffer[0]);
          result := FSoapCAIntf.SMSInterface(
                                             SysParams.CAIntf.IntfVersion,
                                             strRequest,
                                             SysParams.CAIntf.SMSCode,
                                             LowerCase(strBuffer)
                                            );        LogByDay(result);
        end;   
      end else
      if SysParams.CAIntf.IntfMode = 3 then
      begin
         LogByDay('测试环境')
      end;   
    end;
    end.
      

  2.   

    我发现时md5的问题,我在delphi webdebug下测试时没有问题,在isapi环境下就不行了