⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 serverlibrary_intf.pas

📁 著名的SecureBlackBox控件完整源码
💻 PAS
字号:
unit ServerLibrary_Intf;

{----------------------------------------------------------------------------}
{ This unit was automatically generated by the RemObjects SDK after reading  }
{ the RODL file associated with this project .                               }
{                                                                            }
{ Do not modify this unit manually, or your changes will be lost when this   }
{ unit is regenerated the next time you compile the project.                 }
{----------------------------------------------------------------------------}

interface

uses
  {vcl:} Classes, TypInfo,
  {RemObjects:} uROClasses, uROClient, uROTypes, uROClientIntf;

const
  LibraryUID = '{EB53734D-1559-449C-8903-FB33AB71C02C}';

  IServerService_IID : TGUID = '{EB53734D-1559-449C-8903-FB33AB71C02C}';

type
  { Forward declarations }
  IServerService = interface;

  { IServerService }

  { Description:
      Service_ServerService__This_service_has_been_automatically_generated_using_the_RODL_template_you_can_find_in_the_Templates_directory_ }
  IServerService = interface
    ['{EB53734D-1559-449C-8903-FB33AB71C02C}']
    function GetServerTime: DateTime;
    function UploadAFile(const FileName: String; const FileBin: Binary): Boolean;
    function DownloadAFile(const FileName: String; out FileBin: Binary): Boolean;
  end;

  { CoServerService }
  CoServerService = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IServerService;
  end;

  { TServerService_Proxy }
  TServerService_Proxy = class(TROProxy, IServerService)
  protected
    function __GetInterfaceName:string; override;

    function GetServerTime: DateTime;
    function UploadAFile(const FileName: String; const FileBin: Binary): Boolean;
    function DownloadAFile(const FileName: String; out FileBin: Binary): Boolean;
  end;

implementation

uses
  {vcl:} SysUtils,
  {RemObjects:} uROEventRepository, uRORes;

{ CoServerService }

class function CoServerService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IServerService;
begin
  result := TServerService_Proxy.Create(aMessage, aTransportChannel);
end;

{ TServerService_Proxy }

function TServerService_Proxy.__GetInterfaceName:string;
begin
  result := 'ServerService';
end;

function TServerService_Proxy.GetServerTime: DateTime;
var __request, __response : TMemoryStream;
begin
  __request := TMemoryStream.Create;
  __response := TMemoryStream.Create;

  try
     __Message.Initialize(__TransportChannel, 'ServerLibrary', __InterfaceName, 'GetServerTime');
     __Message.Finalize;

     __Message.WriteToStream(__request);
     __TransportChannel.Dispatch(__request, __response);
     __Message.ReadFromStream(__response);

     __Message.Read('Result', TypeInfo(DateTime), result, [paIsDateTime]);
  finally
    __request.Free;
    __response.Free;
  end
end;

function TServerService_Proxy.UploadAFile(const FileName: String; const FileBin: Binary): Boolean;
var __request, __response : TMemoryStream;
begin
  __request := TMemoryStream.Create;
  __response := TMemoryStream.Create;

  try
     __Message.Initialize(__TransportChannel, 'ServerLibrary', __InterfaceName, 'UploadAFile');
     __Message.Write('FileName', TypeInfo(String), FileName, []);
     __Message.Write('FileBin', TypeInfo(Binary), FileBin, []);
     __Message.Finalize;

     __Message.WriteToStream(__request);
     __TransportChannel.Dispatch(__request, __response);
     __Message.ReadFromStream(__response);

     __Message.Read('Result', TypeInfo(Boolean), result, []);
  finally
    __request.Free;
    __response.Free;
  end
end;

function TServerService_Proxy.DownloadAFile(const FileName: String; out FileBin: Binary): Boolean;
var __request, __response : TMemoryStream;
begin
  __request := TMemoryStream.Create;
  __response := TMemoryStream.Create;

  try
     __Message.Initialize(__TransportChannel, 'ServerLibrary', __InterfaceName, 'DownloadAFile');
     __Message.Write('FileName', TypeInfo(String), FileName, []);
     __Message.Finalize;

     __Message.WriteToStream(__request);
     __TransportChannel.Dispatch(__request, __response);
     __Message.ReadFromStream(__response);

     __Message.Read('Result', TypeInfo(Boolean), result, []);
     __Message.Read('FileBin', TypeInfo(Binary), FileBin, []);
  finally
    __request.Free;
    __response.Free;
  end
end;

initialization
  RegisterProxyClass(IServerService_IID, TServerService_Proxy);

finalization
  UnregisterProxyClass(IServerService_IID);
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -