unit ServerMethodsUnit1;
interface
uses
  System.SysUtils, System.Classes, Datasnap.DSServer, Datasnap.DSAuth;

type
  [TRoleAuth('client', 'dummy')]
  TMyServerMethods = class(TDSServerModule)
  private
    { Private declarations }
  public
    { Public declarations }
    function EchoString(Value: string): string;
    [TRoleAuth('admin', 'guest')]
    function ReverseString(Value: string): string;
    function ServerTime: TDateTime;
    function Add33(const X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,
      X11,X12,X13,X14,X15,X16,X17,X18,X19,X20,
      X21,X22,X23,X24,X25,X26,X27,X28,X29,X30,
      X31,X32,X33: Integer): Integer;
  end;

implementation
uses
  System.StrUtils,
  System.ObjAuto;

{$R *.dfm}

function TMyServerMethods.Add33(const X1, X2, X3, X4, X5, X6, X7, X8, X9, X10,
  X11, X12, X13, X14, X15, X16, X17, X18, X19, X20, X21, X22, X23, X24, X25,
  X26, X27, X28, X29, X30, X31, X32, X33: Integer): Integer;
begin
  Result := X1+X2+X3+X4+X5+X6+X7+X8+X9+X10+ X11+X12+X13+X14+X15+X16+X17+
            X18+X19+X20+X21+X22+X23+X24+X25+X26+X27+X28+X29+X30+X31+X32+X33
end;

function TMyServerMethods.EchoString(Value: string): string;
begin
  Result := Value;
end;

function TMyServerMethods.ReverseString(Value: string): string;
begin
  Result := System.StrUtils.ReverseString(Value);
end;

function TMyServerMethods.ServerTime: TDateTime;
begin
  Result := Now
end;

end.

