Magento 1.9 – Fix Uncaught SoapFault Exception [SOAP-ENV:Client]

apimagento-1.9soapsoap-api-v2

I am using SOAP api to integrate an ERP system but throws fatal error Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] Error cannot find parameter

<?php
require_once(__DIR__ . '/app/Mage.php');
Mage::app();

$api_url_v2 = "https://ninobambino.in/index.php/api/v2_soap/?wsdl=1";

$username = 'test123';
$password = 'test123';

$cli = new SoapClient($api_url_v2);

//retreive session id from login
//$session_id = $cli->login($username, $password);
$session = $cli->login('test123', 'test123');

//call customer.list method
$result = $cli->customerCustomerList($session_id);
print_r($result);

Best Answer

Problem is when you pass session to get customer list $result = $cli->customerCustomerList($session_id);

Now change to following code:


<?php
$api_url_v2 = "https://ninobambino.in/index.php/api/v2_soap/?wsdl";

$username = 'test123';
$password = 'test123';

$cli = new SoapClient($api_url_v2);

//retreive session id from login
//$session_id = $cli->login($username, $password);
$session = $cli->login('test123', 'test123');

//call customer.list method
$result = $cli->customerCustomerList($session);
print_r($result);
Related Topic