You are not logged in.
Pages: 1
Hi, I have a timeout error when I execute a "IRemoteAction = interface(IInvokable)" that exceeds a few seconds of running time.
I implemented a service that performs a server-side, and after a few seconds you encounter the below error:
" ... raised exception class EWinHTTP with message 'winhttp.dll error 12002 (timeout)'."
and the error:
"TinterfaceObjectFackeClient.FakeCall(IRemoteAction.ExecuteSchedules) failed:'URI root/RemoteAction.ExecuteSchedules[[253],1,0] returned status 'Invalid Request' (501 - Server not reacheable)".
but the operation "ExecuteSchedules" is successful!!!
because waiting for the event execution order, you can only make a call?
//Interface declaration
IRemoteAction = interface(IInvokable)
['{D6369DD7-6E9C-4C73-8283-87957977B2FC}']
procedure ExecuteSchedules(const aIDs: TIntegerDynArray; Force: Integer;
Preview: Integer);
end;
..............
//Class declaration
TRemoteAction = class(TInterfacedObject, IRemoteAction)
public
procedure ExecuteSchedules(const aIDs: TIntegerDynArray; Force: Integer = 1;
Preview: Integer = 1);
end;
procedure TRemoteAction.ExecuteSchedules(const aIDs: TIntegerDynArray; Force, Preview: Integer);
begin
if Assigned(DmdScheduleServer) then
DmdScheduleServer.ExecuteSchedules(aIDs,Boolean(Force),Boolean(Preview));
end;
..........
//Server Side
MemoryDB := TSQLLogRestServer.Create(MemoryModel,'ScheduleMemory',false,false);
// register our TRemoteAction implementation
MemoryDB.ServiceRegister(TRemoteAction,[TypeInfo(IRemoteAction)],sicSingle);
// launch the HTTP server
MemoryServer := TSQLHttpServer.Create(inttostr(fNuvRegistry.ScheduleServerHttpPort),[MemoryDB],'+',useHttpApiRegisteringURI);
........
//Client Side
fClient.ServiceRegister([TypeInfo(IRemoteAction)],sicSingle);
if fClient.Services['RemoteAction'].Get(I) then
I.ExecuteSchedules(aIDs,Integer(Force),Integer(Preview));
thanks corchi
Offline
I tried to execute the "callback" but I have the same error when the procedure arrive to line that execute Ctxt.Success();
procedure TSQLLogRestServer.ExecuteSchedules(Ctxt: TSQLRestServerURIContext);
var
i :Integer;
IDs: TIntegerDynArray;
sID:RawUTF8;
aForce,aPreview: Integer;
begin
UrlDecodeValue (Ctxt.Parameters,'IDS=',sID,@Ctxt.Parameters);
if UrlDecodeNeedParameters(Ctxt.Parameters,'FORCE') then
UrlDecodeInteger(Ctxt.Parameters,'FORCE=',aForce,@Ctxt.Parameters)
else
aForce := Integer(false);
if UrlDecodeNeedParameters(Ctxt.Parameters,'PREVIEW') then
UrlDecodeInteger(Ctxt.Parameters,'PREVIEW=',aPreview,@Ctxt.Parameters)
else
aPreview := Integer(false);
CSVToIntegerDynArray(PUTF8Char(sID),IDs);
DmdScheduleServer.ScheduleThread.AExecute(IDs, boolean(aForce),boolean(aPreview)); // This function takes about 30 seconds
Ctxt.Success(); //when this line is executed the error occurs
end;
Offline
IMHO the timeout error is on client side, not server side...
When I was speaking about a "callback", I meant http://synopse.info/files/html/Synopse% … l#TITL_149 - not method-based service.
Offline
Pages: 1