Ive been trying for the last few hours to work out this, but for the life of me cant get it right -
http://publicapi.ekmpowershop19.com/v1.1/publicapi.asmx?wsdl
Im trying to use the "GetOrders" function in the above SOAP request, i have been reading tutorial after tutorial but keep getting the following error -
object(stdClass)#2 (1) { ["GetOrdersResult"]=> object(stdClass)#3 (5) { ["Status"]=> string(7) "Failure" ["Errors"]=> object(stdClass)#4 (1) { ["string"]=> string(53) "Object reference not set to an instance of an object." } ["Date"]=> string(33) "2017-04-24T13:08:03.1200825+01:00" ["TotalOrders"]=> int(0) ["TotalCost"]=> NULL } }
The PHP code i am using is -
<?php $trace = true;
$exceptions = true;
$test = new
SoapClient('http://publicapi.ekmpowershop19.com/v1.1/publicapi.asmx?wsdl',
array('trace' => $trace, 'exceptions' => $exceptions));
$xml_array['APIKey'] = REMOVED;
$getorders = $test->GetOrders($xml_array);
var_dump($getorders);
?>
EDIT - Also just tried the below codes to the same effect -
<?php
$trace = true;
$exceptions = true;
$client = new SoapClient("http://publicapi.ekmpowershop19.com/v1.1/publicapi.asmx?wsdl",
array(
"trace" => 1, // enable trace to view what is happening
"exceptions" => 0, // disable exceptions
"cache_wsdl" => 0) // disable any caching on the wsdl, encase you alter the wsdl server
);
print_r( $client->GetOrders(array("APIKey" => "REMOVED")));
echo "<p>Request :".htmlspecialchars($client->__getLastRequest()) ."</p>";
echo "<p>Response:".htmlspecialchars($client->__getLastResponse())."</p>";
?>