function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DG-AngelDG-Angel 

SoapFault exception: [HTTP] Could not connect to host

Hi
 
I am getting this [HTTP] Could not connect to host  error. Is that the indication that salesforce API  is down?
 
Is there a way we can figure out if the API is down at any time?
 
-DG
qwertyqwerty
I have been noticing this error more and more as well.  It does mean sforce is down.  PHP-SOAP will throw a SoapFault with a faultcode of 'HTTP'.  It's probably a good idea to include some auto-reconnection and retry code for when these errors occur.  I would be sure and re-login as who knows what state your previous session was in.
qwertyqwerty
Sorry I realized I never answered your specific question.

Is there a way we can figure out if the API is down at any time?

 Basically, you shouldn't have to.  An API should *never* be down.  If it can't process your request at that time (eg maintenance), it should return a valid soap fault to that effect.  The only real way to tell if it is not responding is to send a request.  You could try a ping but that only tells you if the machine is up, not if the web server is working properly.