git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.RemObjects@2 b6239004-a887-0f4b-9937-50029ccdca16
127 lines
4.3 KiB
ObjectPascal
127 lines
4.3 KiB
ObjectPascal
unit MegaDemoLibrary_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. }
|
|
{----------------------------------------------------------------------------}
|
|
|
|
{$I Remobjects.inc}
|
|
|
|
interface
|
|
|
|
uses
|
|
{vcl:} Classes,
|
|
{RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf,
|
|
{Used RODL Intf's:} DataAbstract4_Intf,
|
|
{Used RODL Invk's:} DataAbstract4_Invk,
|
|
{Generated:} MegaDemoLibrary_Intf;
|
|
|
|
type
|
|
{$M+}
|
|
TLoginService_Invoker = class(TDataAbstractService_Invoker)
|
|
private
|
|
protected
|
|
published
|
|
procedure Invoke_Login(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
|
procedure Invoke_Logout(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
|
end;
|
|
{$M-}
|
|
|
|
{$M+}
|
|
TOrdersService_Invoker = class(TDataAbstractService_Invoker)
|
|
private
|
|
protected
|
|
published
|
|
procedure Invoke_GetCustomerOrders(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
|
end;
|
|
{$M-}
|
|
|
|
implementation
|
|
|
|
uses
|
|
{RemObjects:} uRORes, uROClient;
|
|
|
|
{ TLoginService_Invoker }
|
|
|
|
procedure TLoginService_Invoker.Invoke_Login(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
|
{ function Login(const UserName: String; const Password: String; out aLoginInfo: LoginInfo): Boolean; }
|
|
var
|
|
UserName: String;
|
|
Password: String;
|
|
aLoginInfo: MegaDemoLibrary_Intf.LoginInfo;
|
|
lResult: Boolean;
|
|
__lObjectDisposer: TROObjectDisposer;
|
|
begin
|
|
aLoginInfo := nil;
|
|
try
|
|
__Message.Read('UserName', TypeInfo(String), UserName, []);
|
|
__Message.Read('Password', TypeInfo(String), Password, []);
|
|
|
|
lResult := (__Instance as ILoginService).Login(UserName, Password, aLoginInfo);
|
|
|
|
__Message.InitializeResponseMessage(__Transport, 'MegaDemoLibrary', 'LoginService', 'LoginResponse');
|
|
__Message.Write('Result', TypeInfo(Boolean), lResult, []);
|
|
__Message.Write('aLoginInfo', TypeInfo(MegaDemoLibrary_Intf.LoginInfo), aLoginInfo, []);
|
|
__Message.Finalize;
|
|
__Message.UnsetAttributes(__Transport);
|
|
|
|
finally
|
|
__lObjectDisposer := TROObjectDisposer.Create(__Instance);
|
|
try
|
|
__lObjectDisposer.Add(aLoginInfo);
|
|
finally
|
|
__lObjectDisposer.Free();
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
procedure TLoginService_Invoker.Invoke_Logout(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
|
{ procedure Logout; }
|
|
begin
|
|
try
|
|
(__Instance as ILoginService).Logout;
|
|
|
|
__Message.InitializeResponseMessage(__Transport, 'MegaDemoLibrary', 'LoginService', 'LogoutResponse');
|
|
__Message.Finalize;
|
|
|
|
__oResponseOptions := [roNoResponse];
|
|
|
|
finally
|
|
end;
|
|
end;
|
|
|
|
{ TOrdersService_Invoker }
|
|
|
|
procedure TOrdersService_Invoker.Invoke_GetCustomerOrders(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
|
{ function GetCustomerOrders(const CustomerID: String): Binary; }
|
|
var
|
|
CustomerID: String;
|
|
lResult: Binary;
|
|
__lObjectDisposer: TROObjectDisposer;
|
|
begin
|
|
lResult := nil;
|
|
try
|
|
__Message.Read('CustomerID', TypeInfo(String), CustomerID, []);
|
|
|
|
lResult := (__Instance as IOrdersService).GetCustomerOrders(CustomerID);
|
|
|
|
__Message.InitializeResponseMessage(__Transport, 'MegaDemoLibrary', 'OrdersService', 'GetCustomerOrdersResponse');
|
|
__Message.Write('Result', TypeInfo(Binary), lResult, []);
|
|
__Message.Finalize;
|
|
__Message.UnsetAttributes(__Transport);
|
|
|
|
finally
|
|
__lObjectDisposer := TROObjectDisposer.Create(__Instance);
|
|
try
|
|
__lObjectDisposer.Add(lResult);
|
|
finally
|
|
__lObjectDisposer.Free();
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
end.
|