Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Better API error messages with multiCall() [v.1.4.1.0]
 
jonathan.dh
Jr. Member
 
Avatar
Total Posts:  11
Joined:  2010-06-02
 

While playing around with the SOAP API, it turns out the error messages are not always very helpful, especially when using the multiCall() method.

Using call() I would get good error messages (eg “The value of attribute “SKU” must be unique."), but mutiCall() would only return “Internal Error. Please see log for details.”.

The solution has been to __modify a core file__ for it to return the correct error message.

Note: I’ve only tested this with the SOAP protocol though it should work for XMLRPC too.

* Magento version: 1.4.1.0
* File to edit : /app/code/core/Mage/Api/Model/Server/Handler/Abstract.php
* Line: 418

Replace this :

$result[] $this->_faultAsArray('internal');

With this:

$result[] $this->_faultAsArray('internal'null$e->getMessage());

Now all your calls to multiCall() return the same error messages as call() ! smile

P.S.  The following posts have helped me to get the API working correctly :

Fix n°1 : http://www.magentocommerce.com/boards/viewreply/246368/

Fix n°2 (php 5.3 only ?) : http://www.magentocommerce.com/boards/viewreply/185717/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top