Search code examples
magentosoapmagento-soap-api

Fatal error: Uncaught SoapFault exception: [Client] Function ("call")


I'm using SOAP API to print the product information using it's SKU in Magento. Code is working fine on local server but it's throws fatal error on live server Fatal error: Uncaught SoapFault exception: [Client] Function ("call") is not a valid method for this service....

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

$mage_url = 'http://mylivedomain.com/api/v2_soap/?wsdl' ;
$mage_user = 'username'; 
$mage_api_key = 'password'; 
// Initialize the SOAP client 
$soap = new SoapClient( $mage_url ); 
// Login to Magento 
$session_id = $soap->login( $mage_user, $mage_api_key );
$resources = $soap->resources( $session_id );
$product = $soap->call( $session_id, 'catalog_product.info', ergo10000012 );
print_r ($product);

Solution

  • This is becuase the SOAP version and the web-service call methods are mismatching...

    The URL should be : $mage_url = 'http://mylivedomain.com/api/soap/?wsdl' ;