In xmlrpcs.inc, xmlrpc() provides for two different types of structures of callbacks, one that allows for introspection services and the other that does not.
For the latter, when initializing the callbacks for the server, it executes this line of code:
$xmlrpc_server->signatures[$key] = '';
Later on, if system.methodSignature is invoked for one of the methods, it executes this code:
if (!is_array($xmlrpc_server->signatures[$methodname])) {
return xmlrpc_error(-32601, t('Server error. Requested method @methodname signature not specified.', array("@methodname" => $methodname)));
}This is contrary to the specification at http://xmlrpc-c.sourceforge.net/introspection.html :
Errors
The RPC fails if the server does not have a method by the indicated name, or does not want to admit that it does. But if the method name appears in the response to system.listMethods, the RPC does not fail this way.
This suggests that the response should be the “I don’t know” response, rather than a failure.
This patch provides that response.
Closely related, I preserved this code fragment, which seems dubious:
$return = array();
foreach ($xmlrpc_server->signatures[$methodname] as $type) {
$return[] = $type;
}
It is different from the following if the input array is associative, but that seems unlikely:
$return = $xmlrpc_server->signatures[$methodname]
| Comment | File | Size | Author |
|---|---|---|---|
| xmlrpcs.inc_.patch | 1.22 KB | Daniel Norton |
Comments
Comment #1
fgmDuplicate of #897130: system.methodSignature should return "undef" instead of error -32601, it seems ?
Comment #2
Daniel Norton commentedI don't imagine it’s a dup as it’s not restricted to 8.x and there's no dev release for 8.x., yet.