API integration error
Question asked by James Sarjeant 3 years ago
Hi,
I've created some code using the PHP API examples you have on GitHub. I got the code working successfully on a test server but pushing to the live environment I'm suddenly getting an error saying SoapClient class could not be found.
I've uploaded all the code so that is all fine as far as I can see. I created a wrapper class for the various bits needed and that looks as follows:
class clearbooks extends dbdata{
private $client;
public function __construct()
{
global $arrConfig;
parent::__construct();
$clearbooksUrl = $arrConfig['clearBooksURL'];
$this->client = new SoapClient($clearbooksUrl.'api/accounting/wsdl/');
$this->client->__setSoapHeaders(array(
new SoapHeader($clearbooksUrl . 'api/accounting/soap/',
'authenticate', array('apiKey' => $arrConfig['clearBooksAPIKey'])),
));
}
The $arrConfig array exists and is populated. There is also an autoload in the config file which works fine on the test site, and for everything else, and again hasn't changed.
I have no idea where the issue lies, so does anyone else have this problem or a solution to it? I can provide more code details if need be.
Thanks in advance.