While testing a new module built on Services 6.x-3.0-rc3, I found errors while calling node.retrieve using xmlrpc. After further testing I found the following code at line 69 of servers/xmlrpc_server/xmlrpc_server.module:

if(is_array($controller['args'])) {
foreach($controller['args'] as $index => $arg) {
if($arg['optional'] && isset($arg['default value']) && !isset($args[$index])) {
$args[$index] = $arg['default value'];
} else {
if($arg['optional'] == FALSE) {
return services_error(t('Missing required argument @arg', array(
'@arg' => $arg['name'],
)), 401);
}
}
}

This appears to result in an error for every required argument even if it is passed in. The issue was corrected by changing the last if condition to the following:

if($arg['optional'] == FALSE && !isset($args[$index])) {

Comments

kylebrowning’s picture

rgarand’s picture

That seems to be related to named arguments, while this happens with unnamed arguments - I don't know Services well enough to say if they're the same issue.

BillyMG’s picture

I believe it's a duplicate of #1239516: XMLRPC can not work currently, due to default argument code, which has the exact same fix. I don't believe the fix has been pushed into an RC. The patch in that other ticket is the same as described above and should solve the problem.

kylebrowning’s picture

Status: Active » Closed (duplicate)