Note that there are some explanatory texts on larger screens.

plurals
  1. POSOAP: Fatal Error .. Could not connect to host
    primarykey
    data
    text
    <p>I've tried everything I can think of to no avail, and hope you can help.</p> <p>I've taken on a site from another web dev, so am working on existing code.</p> <p>The code works on my own development server (debian VM on my Win7 machine), but not on the live server (WHM/cPanel admin'd REDHAT Enterprise 5.4 x86_64 standard).</p> <p>I get the following error after the call to <code>$BHclient-&gt;startSession</code>:</p> <pre><code>Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in /home/aap3r/public_html/soap_test.php:60 Stack trace: #0 [internal function]: SoapClient-&gt;__doRequest('&lt;?xml version="...', 'https://api.bul...', '', 1, 0) #1 /home/aap3r/public_html/soap_test.php(60): SoapClient-&gt;__call('startSession', Array) #2 /home/aap3r/public_html/soap_test.php(60): SoapClient-&gt;startSession(Object(stdClass)) #3 {main} thrown in /home/aap3r/public_html/soap_test.php on line 60 </code></pre> <p>The WDSL file is downloaded okay (though it appears to have the wrong mime-type).</p> <p>Since the exact same test code works on one server but not another I thought it was a firewall issue, but the host denies it.</p> <p>The relevant code:</p> <pre><code>$url = "http://api.bullhornstaffing.com/webservices-2.0/?wsdl"; ini_set('soap.wsdl_cache_enabled',1); ini_set('soap.wsdl_cache_ttl',1); $username = "xxx"; $password = "xxx"; $apiKey = "xxxx"; $session_request = new stdClass(); $session_request-&gt;username = $username; $session_request-&gt;password = $password; $session_request-&gt;apiKey = $apiKey; $BHclient = new SoapClient($url, array("trace" =&gt; true, "exception" =&gt; false)); $API_session = $BHclient-&gt;startSession($session_request); print_r($API_session); </code></pre> <p><code>phpinfo</code> confirms that SOAP is installed, and I've tried the various implementation/installation methods presented in the control panels.</p> <p>I've updated to PHP Version 5.3.27 and Apache to 2.2.25.</p> <p>Any help will be hugely appreciated.</p> <hr> <p>Update: I've found a workaround. For whatever reason the production server couldn't connect to HTTP*S*, so I copied and rehosted the WDSL file after manually editing it to replace the protocol.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload