ZF-2872: Zend_XmlRpc_Server throws an exception "Calling parameters do not match signature" with base64

Description

Zend_XmlRpc_Server throws an exception "Calling parameters do not match signature" with base64.

Code to illustrate


/**
 * Enter description here...
 *
 * @param base64 $data
 * @return base64
 */

public function setAvatar($data) {
    return $data;
} 

$client = new Zend_XmlRpc_Client(".");

$avatar = array(
    'type' => 'base64',
    'value' => file_get_contents('avatar.jpg')
);
$response = $client->call("setAvatar", array($avatar)); 

From XML-RPC server we got error "Calling parameters do not match signature", and if we change {{@param base64 $data}} to {{@param string $data}} no error happens.

I've watched code, so here is my opinion on this Issue:

One part of issue is in Zend_XmlRpc_Request, in loadXml method. It's parses XML to params (protected member $_params) and saves them as native PHP array with native PHP types. So at this part information about base64 in RPC request is lost.

Second part of this Issue is in Zend_XmlRpc_Server, in _handle method. It's uses params array from Request (Zend_XmlRpc_Request, witch has native PHP types) and compares them with RPC method's Reflection data (where it has base64). Here we got this "Calling parameters do not match signature".

Possibly, fixing issue in Zend_XmlRpc_Request->loadXml and tiny fixes for all Zend_XmlRpc_Request to store data about requested param's types should solve this issue, but I'm not sure about depended Zend_XmlRpc functionality.

Comments

Fixed in trunk and 1.5 release branch

I'm assuming this fix is merged to the 1.5 release branch for release with 1.5.1. Please update JIRA if this is not the case.