Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread ServerRequestQueue.AddRequest(TempRequest) times out
Sat, Aug 31 2024 6:44 AMPermanent Link

Graeme Keast

Hi

I have a modal dialog that attempts to execute a server request as follows:

  var
     TempRequest: TServerRequest;
  begin
  FormMain.ApplicationSession.DatabasesResource:= '/Modules';
  TempRequest:= FormMain.ServerRequestQueue.GetNewRequest;
  TempRequest.Method:= rmPut;
  TempRequest.URL:= '/Modules/Feedback';
  TempRequest.Params.Values['Param1']:= 'Parameter 1 value';
  TempRequest
  TempRequest.OnCancel:= ServerRequestCancel;
  TempRequest.OnComplete:= ServerRequestComplete;
  TempRequest.OnError:= ServerRequestError;
  TempRequest.OnProgress:= ServerRequestProgress;
  TempRequest.OnStart:= ServerRequestStart;
  TempRequest.OnTimeout:= ServerRequestTimeout;
  ServerRequestQueue.AddRequest(TempRequest);
  end;

If the URL is '/Modules/Feedbackxx' I get an error stating the the module Feedbackxx does not exist, which is reasonable as the Delphi dll \Modules\Feedbackxx.dll does not exist.

But when the URL is 'modules/Feedback' the execution of TempRequest times out with a status of 0 (zero).

It appears that the dll is never called or used as the TEWBModule.EWBModuleExecute method, which looks like

procedure TEWBModuleFeedback.EWBModuleExecute(xRequest: TEWBWebServerRequest);
  begin
  Debug('%s.EWBModuleExecute.begin'
       ,[ClassName
        ]
       );
  xRequest.ResponseHeaders.Values['Cache-Control']:= 'no-cache';
  xRequest.SendContent('Testing - OK');
  Debug('%s.EWBModuleExecute.end'
       ,[ClassName
        ]
       );
  end;

does not show any output expected from the calls to Debug.

The EWB request log shows nothing and the EWB system log does not show any errors for the correct URL.

Is there anyone in EWB land able to assist me in getting past this problem.
If so, would you please assist.

Regards
Sat, Aug 31 2024 12:44 PMPermanent Link

erickengelke

Avatar

Graeme Keast wrote:

> I have a modal dialog that attempts to execute a server request as follows:

A couple of things,

1. If you make method rmPut or rmPost, then usually you send the parameters as part of the
content field.

2. There is a line which shouldn't compile, just TempRequest, then nothing after it

  TempRequest.Method:= rmPut;
  TempRequest.URL:= '/Modules/Feedback';
  TempRequest.Params.Values['Param1']:= 'Parameter 1 value';
  TempRequest
  TempRequest.OnCancel:= ServerRequestCancel;
  TempRequest.OnComplete:= ServerRequestComplete;
  TempRequest.OnError:= ServerRequestError;
  TempRequest.OnProgress:= ServerRequestProgress;
  TempRequest.OnStart:= ServerRequestStart;
  TempRequest.OnTimeout:= ServerRequestTimeout;
  ServerRequestQueue.AddRequest(TempRequest);

3. You need to tell the Request Queue to start.  See my blog article
https://www.erickengelke.com/posts/post34.html


> If the URL is '/Modules/Feedbackxx' I get an error stating the the module Feedbackxx does not exist, which is reasonable as the Delphi dll \Modules\Feedbackxx.dll does not exist.

If you specify / then you are giving a hard path, if you don't, you are using a relative path.
Check that your case is fine, because you have '/Modules' and 'modules...'

Good luck.

Erick
EWB Programming Books and Nice Component Library
See my EWB BLOG posts, at:
http://www.erickengelke.com
Sat, Aug 31 2024 12:44 PMPermanent Link

erickengelke

Avatar

Graeme Keast wrote:

> I have a modal dialog that attempts to execute a server request as follows:

A couple of things,

1. If you make method rmPut or rmPost, then usually you send the parameters as part of the
content field.

2. There is a line which shouldn't compile, just TempRequest, then nothing after it

  TempRequest.Method:= rmPut;
  TempRequest.URL:= '/Modules/Feedback';
  TempRequest.Params.Values['Param1']:= 'Parameter 1 value';
  TempRequest
  TempRequest.OnCancel:= ServerRequestCancel;
  TempRequest.OnComplete:= ServerRequestComplete;
  TempRequest.OnError:= ServerRequestError;
  TempRequest.OnProgress:= ServerRequestProgress;
  TempRequest.OnStart:= ServerRequestStart;
  TempRequest.OnTimeout:= ServerRequestTimeout;
  ServerRequestQueue.AddRequest(TempRequest);

3. You need to tell the Request Queue to start.  See my blog article
https://www.erickengelke.com/posts/post34.html


> If the URL is '/Modules/Feedbackxx' I get an error stating the the module Feedbackxx does not exist, which is reasonable as the Delphi dll \Modules\Feedbackxx.dll does not exist.

If you specify / then you are giving a hard path, if you don't, you are using a relative path.
Check that your case is fine, because you have '/Modules' and 'modules...'

Good luck.

Erick
EWB Programming Books and Nice Component Library
See my EWB BLOG posts, at:
http://www.erickengelke.com
Sat, Aug 31 2024 12:44 PMPermanent Link

erickengelke

Avatar

Graeme Keast wrote:

> I have a modal dialog that attempts to execute a server request as follows:

A couple of things,

1. If you make method rmPut or rmPost, then usually you send the parameters as part of the
content field.

2. There is a line which shouldn't compile, just TempRequest, then nothing after it

  TempRequest.Method:= rmPut;
  TempRequest.URL:= '/Modules/Feedback';
  TempRequest.Params.Values['Param1']:= 'Parameter 1 value';
  TempRequest
  TempRequest.OnCancel:= ServerRequestCancel;
  TempRequest.OnComplete:= ServerRequestComplete;
  TempRequest.OnError:= ServerRequestError;
  TempRequest.OnProgress:= ServerRequestProgress;
  TempRequest.OnStart:= ServerRequestStart;
  TempRequest.OnTimeout:= ServerRequestTimeout;
  ServerRequestQueue.AddRequest(TempRequest);

3. You need to tell the Request Queue to start.  See my blog article
https://www.erickengelke.com/posts/post34.html


> If the URL is '/Modules/Feedbackxx' I get an error stating the the module Feedbackxx does not exist, which is reasonable as the Delphi dll \Modules\Feedbackxx.dll does not exist.

If you specify / then you are giving a hard path, if you don't, you are using a relative path.
Check that your case is fine, because you have '/Modules' and 'modules...'

Good luck.

Erick
EWB Programming Books and Nice Component Library
See my EWB BLOG posts, at:
http://www.erickengelke.com
Sat, Aug 31 2024 12:46 PMPermanent Link

erickengelke

Avatar

erickengelke wrote:

sorry for the repeats, Elevate was taking so long to respond it felt like the Post button wasn't working and I double clicked, forcing three posts.

Erick
EWB Programming Books and Nice Component Library
See my EWB BLOG posts, at:
http://www.erickengelke.com
Fri, Sep 6 2024 9:54 PMPermanent Link

Graeme Keast

Hi Erik

Thanks for your response.

I believe that the ExecuteRequests method is called at the end of the AddRequest method and so does not need to be called after the AddRequest method.


From WebHTTP:

procedure TServerRequestQueue.AddRequest(Value: TServerRequest);
begin
  FPendingQueue.Queue(Value);
  ExecuteRequests;
end;
Sat, Sep 7 2024 8:42 AMPermanent Link

Graeme Keast

Hi Erik

I have resolved my problem and it wasn't an EWB problem. Is was a 'me' problem.

Seems as though my TEWBModule.OnExecute property was cleared in my native Delphi module.

I do appreciate you help.

Regards
Graeme
Image