Magento – Magento : Soap api not working

apimagento-1.9soap

Hi i am using magento vesion 1. 9
and i am trying to call magento soap apiv2 using php.

i use the following code.

$proxy = new SoapClient('http://domain/index.php/api/v2_soap/?wsdl=1');
$sessionId = $proxy->login((object)array('username' => 'user', 'apiKey' => 'password'));
$product = $proxy->catalogProductInfo((object)array('sessionId' => $sessionId->result, 'productId' => '27'));

i get the session id (i testes it by printing the id)
but when i make a soap call

$product = $proxy->catalogProductInfo((object)array('sessionId' => $sessionId->result, 'productId' => '27'));

the browser showing "Server error"

api user having full permission in the back end.
but still it is not working. please some one help me to find the solution.

Best Answer

Change the getProductInfo call to this

$product = $proxy->catalogProductInfo($sessionId->result , 27);
Related Topic