2
I’m reformulating my question regarding the Callback methodology.
I would like some specific example or material of how to use Callbacks calls from the server to the client.
Example:
CLIENT SIDE
In the client I have this class Tcallback
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
From now that this my doubt,the server received the Callback by the method setCallback
procedure TSMPrincipal.SetCallBack(CallBack: TDBXCallback);
var
  FCallBack: TDBXCallback;
begin
  FCallBack := CallBack;
  FConnection.ConnectionName := GetConnectionName;
  FConnection.Connected := True;
end;
There at some point the server call the method in the client, how to do this?
Result := FCallBack.GetConnectionName(Dataset.Data);
Thanks, @Edgarmunizberlinck !!! Andreano’s material is always very good. I’ll take a look at the full
– LeoBJr