namespace DataSnapWebClient;

interface

uses
  System.Linq,
  System.Web,
  System.Web.UI;

type
  _Default = public partial class(System.Web.UI.Page)
  protected
    method Button1_Click(sender: System.Object; e: System.EventArgs); 
  end;

implementation

method _Default.Button1_Click(sender: System.Object; e: System.EventArgs);
var
  Client: ClientProxy1.TMyServerMethodsClient;
  Connection: Borland.Data.TAdoDbxDatasnapConnection;
begin
  Connection := new Borland.Data.TAdoDbxDatasnapConnection();
  Connection.ConnectionString := 
    'communicationprotocol=http;hostname=www.bobswart.nl;port=80;' + 
    'urlpath=/DataSnapXE2/DataSnapServerRESTISAPI.dll;' + 
    'dsauthenticationuser=Bob;dsauthenticationpassword=Swart';
  Connection.Open;
  try
    Client := ClientProxy1.TMyServerMethodsClient.Create(Connection);
    Response.Write(Client.ReverseString('This is a test!'));
  finally
    Connection.Close;
  end;
end;

end.
