I tried everything that I could think of to no avail, and I hope you can help.
I took the site from another web developer, so I'm working on existing code.
The code runs on my own development server (debian VM on my Win7 machine), but not on the real server (WHM / cPanel admin'd REDHAT Enterprise 5.4 x86_64).
After calling $BHclient->startSession , the following error appears:
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->__doRequest('<?xml version="...', 'https://api.bul...', '', 1, 0) #1 /home/aap3r/public_html/soap_test.php(60): SoapClient->__call('startSession', Array) #2 /home/aap3r/public_html/soap_test.php(60): SoapClient->startSession(Object(stdClass)) #3 {main} thrown in /home/aap3r/public_html/soap_test.php on line 60
The WDSL file loads in order (although it seems to have the wrong mime type).
Since the same test code runs on one server, but not on another, I thought it was a firewall problem, but the host denies this.
Relevant 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->username = $username; $session_request->password = $password; $session_request->apiKey = $apiKey; $BHclient = new SoapClient($url, array("trace" => true, "exception" => false)); $API_session = $BHclient->startSession($session_request); print_r($API_session);
phpinfo confirms that SOAP is installed and I have tried various implementation / installation methods presented in the control panels.
I upgraded PHP version 5.3.27 and Apache to version 2.2.25.
Any help would be greatly appreciated.
Update: I found a workaround. For some reason, the production server could not connect to HTTP * S *, so I copied and reinstalled the WDSL file after manually editing it to replace the protocol.