When I enable only some calls, still all possible calls from all resources get listed on system.listMethods call.

Also when I call not enabled call (node.index in test) I do not get proper error message (resource is not found or something). Server side throws PHP warning (from watchdog):
a:3:{i:0;s:163:"call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, '' was given";i:1;s:7:"Warning";i:2;a:3:{s:8:"function";s:29:"services_controller_execute()";s:4:"file";s:68:"/var/www/services/d7/sites/all/modules/services/services.runtime.inc";s:4:"line";i:131;}}

Comments

ygerasimov’s picture

StatusFileSize
new4.09 KB

Attached test to reproduce.

ygerasimov’s picture

Assigned: Unassigned » ygerasimov
ygerasimov’s picture

Status: Active » Needs review
StatusFileSize
new824 bytes

See attached patch that fixes bug with listing all possible methods (not even enabled).

mente’s picture

StatusFileSize
new728 bytes

Using $_GET is not good approach. You can use server_get_info() to fetch current endpoint. See attached. Apply to your own patch

mente’s picture

StatusFileSize
new607 bytes

And one more patch for tests, that will through exception, when disabled methods are listed. Apply to ygerasimov patches, as well

ygerasimov’s picture

StatusFileSize
new6.51 KB

@mente thank you very much for the catch. You are completely right.

Here is patch with test. Test also shows how to log in and call method (user.index) as logged in user. Patch done with git diff --no-prefix.

In order tests to run we need to apply also patch from #1016350: Do not prefix actions in the xmlrpc server

ygerasimov’s picture

As suggested in http://drupal.org/node/1016350#comment-4143282 adding precedence test. Patch attached.

gdd’s picture

StatusFileSize
new12.63 KB

The patch in #7 was actually this issue combined with #1016350: Do not prefix actions in the xmlrpc server. That patch has been committed now, so here is a reroll with just the new changes. Note this still needs review and testing, i havent even run it yet. Git is causing me problems!

ygerasimov’s picture

StatusFileSize
new12.33 KB

I have changed patch adding all arguments because of #1077556: XMLRPC server. Handling arguments. All tests pass. Please review.

gdd’s picture

Status: Needs review » Closed (fixed)

Committed, thanks!