Time out Webservice

Time out Webservice

  
I am exposing some resful webservices. Is there way to have them timout if execution takes longer than 30 seconds? Right now it will take nearly 4.5 minutes to timeout. 
Hi Thomas,

Good point, in fact there's no reference for REST timeout in Documentation ( Consuming REST APIs / Exposing REST APIs) neither in forums discussions (www.outsystems.com/goto/timeouts-guide), at least i couldn't find.

Since REST API it's implemented via HTTP, i would say that is defined by httpRuntime executionTimeout.

In the begin of the request you can 'SetRequestTimeout' method of HttpRequestHandler (extension) in order to set the timeout of the current HTTP request.

Let us know if it worked for you!

Best regards.
Daniel Martins

Daniel Martins wrote:

Hi Thomas,

Good point, in fact there's no reference for REST timeout in Documentation ( Consuming REST APIs / Exposing REST APIs) neither in forums discussions (www.outsystems.com/goto/timeouts-guide), at least i couldn't find.

Since REST API it's implemented via HTTP, i would say that is defined by httpRuntime executionTimeout.

In the begin of the request you can 'SetRequestTimeout' method of HttpRequestHandler (extension) in order to set the timeout of the current HTTP request.

Let us know if it worked for you!

Best regards.
Daniel Martins

Daniel,

As promised, here's my comment ... :)

Your sugestion is valid but is not working for the OutSystems REST services.

I don't understand why, but I've tried everthing! From using the "SetRequestTimeout", using Factory Configuration app approach to override web.config and even using machine.config.

The screen requests (post and ajax) and the SOAP services, all timeout as expected.

The REST services just run forever... I did not found a limit...

I would say that it is related with the MVC/OS specific REST services implementation.


Nontheless, I would say that nothing is impossible (or almost)! :)

Thankfully to Luis Almeida sugestion, I've achived a solution by implementing a wrapper pattern that aborts the service executing thread after a given timeout. Extension fully comented in attach (don't forget to use OS IPP).

Best Regards,

Tiago Peres

Thank you Tiago for sharing this!