In the first instance you might want to check that you can see any errors this might be producing. If this script outputs nothing at all then that might be the case. Put this at the top of the script:
PHP Code:
error_reporting(E_ALL);
ini_set('display_errors', 1);
This should hopefully make any error messages show up in the output. Remember to remove this in production.
Most APIs aren't set up to be called the way you're calling it with the various parameters passed as a query string. Usually, the parameters should be passed directly in the method call, e.g.:
PHP Code:
$res = $client->GetImagesforProduct($userName, $password, $productCode);
But you should check the API documentation to see if you're calling it correctly.
The following only applies if the API has a WSDL (which it should!) but might shed some light on whether you're calling the API in the right way:
PHP Code:
$client = new SoapClient('https://api.domain.com/');
print_r($client->__getFunctions());
SoapClient::__getFunctions is supposed to give you a spec of the actual functions you can call on the client, as a bunch of strings. It's useful to see this as it basically tells you how you should be calling the various functions from php.
Bookmarks