Componentes.Terceros.RemObj.../internal/5.0.23.613/1/RemObjects SDK for Delphi/Samples/FPC Server/SimpleClient.pas
david f0e35ec439 - Eliminadas las librerías para Delphi 6 (Dcu\D6) en RO y DA.
- Recompilación de RO para poner RemObjects_Core_D10 como paquete de runtime/designtime.

git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.RemObjects@3 b6239004-a887-0f4b-9937-50029ccdca16
2007-09-10 10:40:17 +00:00

41 lines
1.1 KiB
ObjectPascal

program SimpleClient;
{$IFDEF FPC}{$MODE DELPHI}{$ENDIF}
uses
SysUtils,
Classes,
uROComInit,
uROBinMessage,
uROIndyHttpChannel,
NewLibrary_Intf;
var
lService: INewService;
lMessage: TROBinMessage;
lChannel: TROIndyHTTPChannel;
a,b: Integer;
begin
try
lMessage := TROBinMessage.Create(TComponent(nil));
lChannel := TROIndyHTTPChannel.Create(nil);
lChannel.Targeturl := 'http://localhost:8099/bin';
try
lService := CoNewService.Create(lMessage, lChannel);
Writeln('Calling Sum(a,b), please enter the first number:');
Readln(a);
Writeln('Please enter the second number:');
Readln(b);
Writeln('Trying to call Sum(a, b)');
Writeln('Result: ', lService.Sum(a, b));
Writeln('Trying to call GetServerTime');
Writeln('Result: ', DateTimeToStr(lService.GetServerTime));
ReadLn;
finally
lChannel.Free;
lMessage.Free;
end;
except
on e: Exception do
Writeln('Error trying to access the server: '+e.Message);
end;
end.