102 lines
3.9 KiB
ObjectPascal
102 lines
3.9 KiB
ObjectPascal
|
|
unit DynamicRequestLibrary_Invk;
|
||
|
|
|
||
|
|
{----------------------------------------------------------------------------}
|
||
|
|
{ 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,
|
||
|
|
{RemObjects:} uROServer, uROServerIntf, uROTypes, uROClientIntf,
|
||
|
|
{Generated:} DynamicRequestLibrary_Intf;
|
||
|
|
|
||
|
|
type
|
||
|
|
TDynamicRequestService_Invoker = class(TROInvoker)
|
||
|
|
private
|
||
|
|
protected
|
||
|
|
published
|
||
|
|
procedure Invoke_Sum(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||
|
|
procedure Invoke_GetServerTime(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||
|
|
procedure Invoke_EchoPerson(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||
|
|
end;
|
||
|
|
|
||
|
|
implementation
|
||
|
|
|
||
|
|
uses
|
||
|
|
{RemObjects:} uRORes, uROClient;
|
||
|
|
|
||
|
|
{ TDynamicRequestService_Invoker }
|
||
|
|
|
||
|
|
procedure TDynamicRequestService_Invoker.Invoke_Sum(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||
|
|
{ function Sum(const A: Integer; const B: Integer): Integer; }
|
||
|
|
var
|
||
|
|
A: Integer;
|
||
|
|
B: Integer;
|
||
|
|
lResult: Integer;
|
||
|
|
begin
|
||
|
|
try
|
||
|
|
__Message.Read('A', TypeInfo(Integer), A, []);
|
||
|
|
__Message.Read('B', TypeInfo(Integer), B, []);
|
||
|
|
|
||
|
|
lResult := (__Instance as IDynamicRequestService).Sum(A, B);
|
||
|
|
|
||
|
|
__Message.InitializeResponseMessage(__Transport, 'DynamicRequestLibrary', 'DynamicRequestService', 'SumResponse');
|
||
|
|
__Message.Write('Result', TypeInfo(Integer), lResult, []);
|
||
|
|
__Message.Finalize;
|
||
|
|
|
||
|
|
finally
|
||
|
|
end;
|
||
|
|
end;
|
||
|
|
|
||
|
|
procedure TDynamicRequestService_Invoker.Invoke_GetServerTime(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||
|
|
{ function GetServerTime: DateTime; }
|
||
|
|
var
|
||
|
|
lResult: DateTime;
|
||
|
|
begin
|
||
|
|
try
|
||
|
|
lResult := (__Instance as IDynamicRequestService).GetServerTime;
|
||
|
|
|
||
|
|
__Message.InitializeResponseMessage(__Transport, 'DynamicRequestLibrary', 'DynamicRequestService', 'GetServerTimeResponse');
|
||
|
|
__Message.Write('Result', TypeInfo(DateTime), lResult, [paIsDateTime]);
|
||
|
|
__Message.Finalize;
|
||
|
|
|
||
|
|
finally
|
||
|
|
end;
|
||
|
|
end;
|
||
|
|
|
||
|
|
procedure TDynamicRequestService_Invoker.Invoke_EchoPerson(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||
|
|
{ procedure EchoPerson(const aPerson: TPerson; out anotherPerson: TPerson); }
|
||
|
|
var
|
||
|
|
aPerson: DynamicRequestLibrary_Intf.TPerson;
|
||
|
|
anotherPerson: DynamicRequestLibrary_Intf.TPerson;
|
||
|
|
__lObjectDisposer: TROObjectDisposer;
|
||
|
|
begin
|
||
|
|
aPerson := nil;
|
||
|
|
anotherPerson := nil;
|
||
|
|
try
|
||
|
|
__Message.Read('aPerson', TypeInfo(DynamicRequestLibrary_Intf.TPerson), aPerson, []);
|
||
|
|
|
||
|
|
(__Instance as IDynamicRequestService).EchoPerson(aPerson, anotherPerson);
|
||
|
|
|
||
|
|
__Message.InitializeResponseMessage(__Transport, 'DynamicRequestLibrary', 'DynamicRequestService', 'EchoPersonResponse');
|
||
|
|
__Message.Write('anotherPerson', TypeInfo(DynamicRequestLibrary_Intf.TPerson), anotherPerson, []);
|
||
|
|
__Message.Finalize;
|
||
|
|
|
||
|
|
finally
|
||
|
|
__lObjectDisposer := TROObjectDisposer.Create(__Instance);
|
||
|
|
try
|
||
|
|
__lObjectDisposer.Add(aPerson);
|
||
|
|
__lObjectDisposer.Add(anotherPerson);
|
||
|
|
finally
|
||
|
|
__lObjectDisposer.Free();
|
||
|
|
end;
|
||
|
|
end;
|
||
|
|
end;
|
||
|
|
|
||
|
|
end.
|