doc:webservices-api:api:better_api_error_messages_with_soap_multicall_v.1.4.1.0

Last modified by jonathan.dh on Sun, July 25, 2010 03:54
Source|Old Revisions  

This is an old revision of the document!


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() ! :)


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 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs