Jan 12, 2010

Posted in Websites | 8 Comments

Magento 1.3 API Bug fixes

  • Sharebar

If your using the latest stable version of Magento 1.3 and are having issues with the XML RPC API you should try modifying the files below.

  • Bug #1: “Calling parameters do not match signature” when doing Login via XML RPC

    The latest version of Zend Framework has altered the some of the array formats which will ultimately cause the Magento API to fail.

    File: lib/Zend/XmlRpc/Server.php

    Find this code:

    if (!$matched) {  #require_once 'Zend/XmlRpc/Server/Exception.php';  throw new Zend_XmlRpc_Server_Exception('Calling parameters do not match signature', 623);}

    Replace with:

    /*if (!$matched) {  #require_once 'Zend/XmlRpc/Server/Exception.php';  throw new Zend_XmlRpc_Server_Exception('Calling parameters do not match signature', 623);}*/
  • Bug #2: “Access Denied” when doing Login via XML RPC

    File: app/code/core/Mage/Api/Model/Server/Handler/Abstract.php

    Find this code:

    public function login($username, $apiKey){  $this->_startSession();  try {    $this->_getSession()->login($username,$apiKey);

    Replace with:

    public function login($username, $apiKey){  $this->_startSession();  try {    $this->_getSession()->login($username[0],$apiKey[0]);

    Find this code:

    public function call($sessionId, $apiPath, $args = array()){<br><br>  $this-&gt;_startSession($sessionId);

    Replace with:

    public function call($sessionId, $apiPath, $args = array()){  $sessionId = $sessionId[0];  $apiPath = $apiPath[0];<br><br>  $this-&gt;_startSession($sessionId);

For any questions regarding this post contact us at http://internetrnd.com/contact-us

Leave a comment if you found this useful!

  1. Hi. thanks but it didn’t seem to work for me

  2. I made both the changes for the Access Denied error, yet its still happening…any insights? Feel free to use the e-mail addy for communication. :) Thanks!

  3. Hello Guys,

    I sent you both an Email with my contact info. I would like to know more about your setup and software versions.

    Thanks!

  4. BTW, I’m not too sure about how secure it is. Hope it’s not a security hole.

  5. @Abdul: The API still requires the proper Login/Key combination. This just fixes a known bug between the updated Zend XML framework and Magento API.

  6. You absolute legend!! :-)

    Been tearing my hair out trying to get the drupal/magento plugins to work and this sorted it

    Thanks a million

    Paul

  7. You absolute legend!! :-)

    Been tearing my hair out trying to get the drupal/magento plugins to work and this sorted it

    Thanks a million

    Paul

  8. Thierry Beeckmans says:

    Strange behaviour from Magento, because without these changes the xml-rpc login call works AFTER I inactivated and reactivated the user.
    I performed a diff and didn’t found any changes in the code anymore (v1.3.2.4), it still works.

Leave a Reply