Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gsoap client call blocks when the server is not available

Tags:

soap

gsoap

I am looking for a method to detect if the gsoap web service is available. Unfortunately when the service is offline then the client gsoap calls block for a long time. Setting the soap.recv_timeout and the soap.send_timeout to zero do not help.

like image 897
Gabor Forgacs Avatar asked Jan 14 '23 17:01

Gabor Forgacs


2 Answers

This is a bit late, but I finally found (what I think is) a better answer by skulking through the source code (why they don't document this, I don't know):

Look for "soap.connect_timeout". When I set this to 3, it times-out after 3 seconds as expected when the web service is unavailable.

The above recv_timeout and send_timeout didn't work for me in the case of "service unavailable".

like image 164
Lee Dixon Avatar answered Jan 21 '23 18:01

Lee Dixon


I'm pretty sure that by setting soap.recv_timeout and soap.send_timeout with 0 means NO TIMEOUT. Try set this variables with 1 (1 means 1 second).

like image 27
nms Avatar answered Jan 21 '23 17:01

nms