In WS-I mode, there are a few minor differences when using the API.
- The result of $ proxy-> login () is an object. You need to extract sessionId.
- When calling $ proxy-> catalogProductList (), you need to provide the parameters in an associative array (as is the case with $ proxy-> login ()).
Please try the following:
<?php try { error_reporting(E_ALL | E_STRICT); ini_set('display_errors', 1); $proxy = new SoapClient('http://127.0.0.1/Magento1620/index.php/api/v2_soap?wsdl', array('trace' => 1, 'connection_timeout' => 120)); $session = $proxy->login(array( 'username' => "zzc000", 'apiKey' => "zzc000" )); $sessionId = $session->result; $filters = array( 'sku' => array('like'=>'zol%') ); $products = $proxy->catalogProductList(array("sessionId" => $sessionId, "filters" => $filters)); echo '<h1>Result</h1>'; echo '<pre>'; var_dump($products); echo '</pre>'; } catch (Exception $e) { echo '<h1>Error</h1>'; echo '<p>' . $e->getMessage() . '</p>'; }
The same applies to other method calls for the WSA-compliant SOA API.
source share