- 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
41 lines
1.1 KiB
ObjectPascal
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.
|