Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: SOAP Webservice Gateway Timeout  (Read 4750 times)
Bothwell W.
Posts: 1


« on: March 08, 2022, 03:20:04 pm »


Good Day

How can I correctly handle " Gateway Timeout "  when my Web Operation function takes too long to complete ? in my code I have:

 
Code
  1.  
  2. WHILE TRUE
  3.  
  4.    CASE com.WebServiceEngine.ProcessServices(-1)
  5.  
  6.     WHEN 0
  7.         COMMIT WORK
  8.  
  9.     WHEN -2
  10.          ROLLBACK WORK
  11.  
  12.      ---
  13.  
  14.     OTHERWISE
  15.          ROLLBACK WORK
  16.  
  17. END WHILE
  18.  
  19.  

While testing a long running process I see that com.WebServiceEngine.ProcessServices() first returns 0 then later returns -2 . so I am not sure how to tell when there is timeout as I am geting both a success and error status on the same request.

the documentation  here: https://4js.com/online_documentation/fjs-fgl-3.00.05-manual-html/c_gws_ComWebServiceEngine_ProcessServices.html mentions a status 0 for a successful web operation so I was not expecting status 0 when the webservice has not replied with the data.

Basically the webservice reads data from a single table and updates a status field in the table to sent.

Is there a better way or the correct class that I should be using ?
crying g.
Posts: 1


« Reply #1 on: March 18, 2024, 09:08:08 am »


Good Day

How can I correctly handle " Gateway Timeout "  when my Web Operation function takes too long to complete ? in my code I have:

 
Code
  1.  
  2. WHILE TRUE
  3.  
  4.    CASE com.WebServiceEngine.ProcessServices(-1)
  5.  
  6.     WHEN 0
  7.         COMMIT WORK
  8.  
  9.     WHEN -2
  10.          ROLLBACK WORK
  11.  
  12.      ---
  13.  
  14.     OTHERWISE
  15.          ROLLBACK WORK
  16.  
  17. END WHILE
  18.  
  19.  

While testing a long running process I see that com.WebServiceEngine.ProcessServices() first returns 0 then later returns -2 . so I am not sure how to tell when there is timeout as I am geting both a success and error status on the same request.

the documentation  here: https://4js.com/online_documentation/fjs-fgl-3.00.05-manual-html/c_gws_ComWebServiceEngine_ProcessServices.html mentions a status 0 for a successful web operation so I was not expecting status 0 when the webservice has not replied with the data.

Basically the webservice reads data from a single table and updates a status field in the table to sent.

Is there a better way or the correct class that I should be using ?

When dealing with a "Gateway Timeout" error in your web operation function, it's important to handle it correctly to ensure proper execution and error handling. In your code, you can modify the handling of the "Gateway Timeout" error as follows:

pgsql
Copy
WHILE TRUE
   CASE com.WebServiceEngine.ProcessServices(-1)
   WHEN 0
      COMMIT WORK
   WHEN -2
      ROLLBACK WORK
   WHEN -31
      -- Handle Gateway Timeout error here
      -- You can perform any necessary actions, such as logging or retrying the operation
   OTHERWISE
      ROLLBACK WORK
END WHILE
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines