You are not logged in.
Sample 04
Form1.Database := TSQLHttpClient.Create(Server,'8080',Form1.Model);
TSQLHttpClient(Form1.Database).SetUser('User','synopse');
if run in Delphi we see message Project Project04Client.exe raised exception class EWinHTTP with message 'Unable to connect to localhost:8080 - server may be down or unavailable'.
i try use terminate on except but nothing happends
Form1.Database := TSQLHttpClient.Create(Server,'8080',Form1.Model);
try
TSQLHttpClient(Form1.Database).SetUser('User','synopse');
except
Application.Terminate;
end;
How to verify that the server is down?
Last edited by noobies (2014-04-11 13:24:01)
Offline
See the SAD 1.18 pdf about this, and also sample 16 for instance:
fModel := TSQLModel.Create([],ROOT_NAME);
fClient := TSQLHttpClient.Create('localhost',PORT_NAME,fModel);
if not fClient.ServerTimeStampSynchronize then begin
ShowLastClientError(fClient,'Please run Project16ServerHttp.exe');
Close;
exit;
end;
if (not fClient.SetUser('User','synopse')) or
(not fClient.ServiceRegisterClientDriven(TypeInfo(IRemoteSQL),fService)) then begin
ShowLastClientError(fClient,'Remote service not available on server');
Close;
exit;
end;
Trick is to execute ServerTimeStampSynchronize first, to check that the server is currently running.
Offline