1. Anja Carsten
  2. PowerBuilder
  3. Tuesday, 17 July 2018 13:40 PM UTC

Has someone experiences with the timeout for HTTPClient?

Using the example from the PB Help causes no errors, but the is no timeout effect:

http = CREATE httpclient
http.Timeout = 120

...

ll_rc = http.SendRequest ( 'POST', gs_webservice, ls_data )   

... and then the request runs and runs and runs, definitly more than 120 seconds.
yael mor Accepted Answer Pending Moderation
  1. Tuesday, 29 August 2023 09:45 AM UTC
  2. PowerBuilder
  3. # 1

hi, i also have same problem as Anja.

my code is :

lhc_Client = Create HttpClient

lhc_Client.SetRequestHeader( "Authorization", "Basic " + ls_Basic)

lhc_Client.SetRequestHeader("Content-Type", "application/json;charset=UTF-8")

lhc_Client.SetRequestHeader('Content-Length', String(Len(lblob_jason)))

lhc_Client.timeout = 3

li_Return = lhc_Client.SendRequest("POST", ls_url,lblob_jason)

 

it takes the reuqst 13 second to return with li_Return=1 the timeout has no effect.

i try adding lhc_Client.SecureProtocol=5 - no change.

how can i stop the request in the middle if i don't get response after no of seconds - maybe stuck...

i'm using pb 2019 R2  it doesn't work also in pb 2019 R3 ( a colleague of mine tried it)

 

thanks

 

Yael

Comment
There are no comments made yet.
Vipin Dwivedi Accepted Answer Pending Moderation
  1. Thursday, 11 July 2019 20:11 PM UTC
  2. PowerBuilder
  3. # 2

Hi Anja,

Did your problem get fixed with Timeout issue? We are planning to make use of Timeout property so thought to check with you. We are using PB2017R3 - Build 1858

 

Thanks, Vipin

Comment
There are no comments made yet.
Ken Guo @Appeon Accepted Answer Pending Moderation
  1. Friday, 20 July 2018 01:19 AM UTC
  2. PowerBuilder
  3. # 3

Hi Anja,

Please verify with the attachment DLL. If the issue persists, I suggest that you open a ticket and provide a reproducible sample case in our support system so we can better track and handle this issue later on.

 

Regards,

Ken

Attachments (1)
Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 18 July 2018 14:03 PM UTC
  2. PowerBuilder
  3. # 4

Hi Anja;

  I can now confirm your timeout setting mismatch in execution ...

Test#1

Test#2

Test#3

 

    Please open a support ticket for this issue. It does not seem to matter how long you set the timeout period, the timeout always seems to occur in 11.4 sec.

 

Regards ... Chris

Comment
There are no comments made yet.
Anja Carsten Accepted Answer Pending Moderation
  1. Wednesday, 18 July 2018 11:18 AM UTC
  2. PowerBuilder
  3. # 5

With SecureProtocol=5 I get -1 (general error) as result of SendRequest.That's fine.

But this process runs much more than 5 sec. SendRequest runs 30 sec and than returns an error instead of the data. This is not really the expected solution.

Without the timeout I have to wait to, but I get a response from webservice.

 

I expected, that timeout defines the time when SendRequest stops. Without a response from the webservice, but after the timeout-Time.

Should I  define an exception handling to stop the SendRequest after the Timeout-time?

How could I realise that SendRequest stops after the Timeout-time?

 

 

 

 

Comment
There are no comments made yet.
Ken Guo @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 18 July 2018 09:49 AM UTC
  2. PowerBuilder
  3. # 6

Hi Anja,

 

Please try to set http.SecureProtocol from 1 to 5 and see if there is any improvement for a certain value.

 

 

Regards,

Ken

Comment
There are no comments made yet.
Anja Carsten Accepted Answer Pending Moderation
  1. Wednesday, 18 July 2018 06:08 AM UTC
  2. PowerBuilder
  3. # 7

Thanks, I've tested the same it with following result:

httpclient http
http = CREATE httpclient

http.SetRequestHeader ( 'apikey', "***" )
http.SetRequestHeader ( 'Content-Type', "application/json" )

http.timeout=5

--> pre SendRequest : 08:00:02
ll_rc = http.SendRequest ( 'POST',  ls_webservice, ls_data )    
--> post SendRequest : 08:00:36

--> ll_rc=1

I receive expected results from the webservice, but in a longer time than the timeout defines.

When I try a false URL I get an other result: 503:Service Unavailable

PBV2017 R2 Build1769 MS Windows 10 Pro

 

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 17 July 2018 14:34 PM UTC
  2. PowerBuilder
  3. # 8

Hi Anja;

   This simple test worked for me using an invalid URL. The SendRequest command waited 10 seconds and then returned me a -1 (fail).

 

Note: I am using PB2017R2 build 1769 on W10 Spring Creator Edition

HTH

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.