unit ClientForm;

interface

uses
  SysUtils, Types, UITypes, Classes, Variants, FMX_Types, FMX_Controls, FMX_Forms,
  FMX_Dialogs, FMX_Layouts, FMX_ListBox;

type
  TForm3 = class(TForm)
    ListBox1: TListBox;
    btnDataSnapConnect: TButton;
    procedure btnDataSnapConnectClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form3: TForm3;

implementation
uses
  DSRESTConnection, DSProxy, DB;

{$R *.lfm}

procedure TForm3.btnDataSnapConnectClick(Sender: TObject);
var
  Server: TDSRestConnection;
  Proxy: TServerMethods1; // name at server
  DataSet: TDataSet;

begin
  Server := TDSRestConnection.Create(nil);
  try
    Server.Host := 'www.bobswart.nl';
    Server.Port := 80;
    Server.UrlPath := '/DataSnapSDE/DataSnapServerSDN.dll';
    Server.Protocol := 'http';

    Proxy := TServerMethods1.Create(Server);
    if Assigned(Proxy) then
    try
      DataSet := Proxy.GetEmployees;
      while not DataSet.Eof do
      try
        ListBox1.Items.Add(
          DataSet.FieldByName('EMP_NO').AsString + ': ' +
          DataSet.FieldByName('FIRST_NAME').AsString + #32 +
          DataSet.FieldByName('LAST_NAME').AsString + ' from ' +
          DataSet.FieldByName('JOB_COUNTRY').AsString);
      finally
        DataSet.Next
      end;
    finally
      Proxy.Free
    end;
  finally
    Server.Free
  end;
end;

end.
