How to stop a HttpRequest

Posted by Arno van der Ende on 02-Nov-2018 09:25

We have a webservice which is not always online, or can only be accessed when a VPN connection is setup.

Is it possible to test the connection, before executing the real POST? Now th POST takes about 40 seconds before an error is thrown. Using SetRequestTimeout and STOP-AFTER does not seem to help.

Code:

oHttpRequest = RequestBuilder:Post(this-object:URI, oRequestBody)
                             :ContentType(this-object:ContentType)
                             :AddHeader("Connection":u, "Keep-Alive":u)
                             :AcceptXml()
                             :Request.

oHttpResponse = ClientBuilder:Build()
                             :SetRequestTimeout(10)
                             :Client
                             :Execute(oHttpRequest).

Posted by Peter Judge on 02-Nov-2018 10:42

There is no way of testing the connection in the HTTP Client . Please log a bug for this.
 
I found this kbase that provides a way of doing this knowledgebase.progress.com/.../000051142 .  I’ve created a sample for this at github.com/.../timeouts . It looks to work quite nicely (the -clientConnectTimeout switch).
 
 
 
 

All Replies

Posted by Peter Judge on 02-Nov-2018 10:42

There is no way of testing the connection in the HTTP Client . Please log a bug for this.
 
I found this kbase that provides a way of doing this knowledgebase.progress.com/.../000051142 .  I’ve created a sample for this at github.com/.../timeouts . It looks to work quite nicely (the -clientConnectTimeout switch).
 
 
 
 

Posted by Arno van der Ende on 04-Nov-2018 14:13

Thank you Peter. I tested this and it works. I can use this workaround.

I also logged a ticket at Progress Support.

This thread is closed