I'm rephrasing my question regarding the CallBack methodology.
I would like some example or specific material on how to use CallBacks calls from the server to the client.
Example:
CLIENT SIDE
On the client I have this TCallBack class
TCallback = class(TDBXCallBack)
Function Execute(const Args: TJSONValue): TJSONValue; override;
function GetConnectionName(OptionList: OleVariant): String;
procedure ShowWaitScreen(const Msg: String);
procedure ReleaseProcessScreen;
function ShowProcessScreen(const ALinha: String; const ACaption: String;
APosition: Integer; ACount2: Integer;): WordBool;
end;
With the code below, somewhere in the client, I send CallBack to the server.
Var
FCallBack: TCallBack;
ClientPx: TSMPrincipalClient;
begin
if (FCallBack = nil) then begin
FCallBack := TCallBack.Create();
end;
try
ClientPx := TSMPrincipalClient.Create(conDataSnap.DBXConnection, False);
ClientPx.SetCallBack(FCallback);
except
on E:Exception do
ExceptionMessage := e.Message;
end;
end;
SERVER SIDE
As of now that is my doubt, the server has been called by the setCallback method
procedure TSMPrincipal.SetCallBack(CallBack: TDBXCallback);
var
FCallBack: TDBXCallback;
begin
FCallBack := CallBack;
FConnection.ConnectionName := GetConnectionName;
FConnection.Connected := True;
end;
At some point on the server I call the method on the client, how do I do this?
Result := FCallBack.GetConnectionName(Dataset.Data);