Closed (fixed)
Project:
Services
Version:
6.x-3.x-dev
Component:
Code
Priority:
Critical
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Jan 2011 at 21:37 UTC
Updated:
18 May 2011 at 19:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
gddIf I read the module right we also prefix relationships and targeted actions correct? I'd like to do this but I need to get a patch together.
Comment #2
gddHere's a patch albeit untested.
Comment #3
voxpelli commentedBy removing the prefix of all three we're risking collisions - but I guess that is okay. Fact is we're already risking collisions as services_controller_get() and services_controllers_list() apparently already works this way (but with the order: 'actions', 'relationships', 'targeted actions'). So I guess actions isn't working at all in XML-RPC right now? Moving to critical.
Since services_controller_get() and services_controllers_list() and _xmlrpc_server_resources_as_procedures() deals with the same functionality I wonder why they have been split up between two modules? I think that either _xmlrpc_server_resources_as_procedures() should be moved out of the XML-RPC module or services_controller_get() and services_controllers_list() should be moved in to it. Considering we've a lot of RPC-style third party servers for Services 2.x I think we should move _xmlrpc_server_resources_as_procedures() out of the XML-RPC module to make methods for converting resources into RPC-methods available for them.
Also - to consistently resolve collisions I think we should define a order of precedence. Most resources wont be constructed with RPC in mind so it's quite important to solve collisions correctly I think. This is what services_controller_get() does today - it's probably the best:
Crud methods > Actions > Relations > Targeted Actions
I think we should move _xmlrpc_server_resources_as_procedures() as part of this issue as well as ensuring that it handles collisions in a good consistent way.
Comment #4
gddThat is a good idea. Here is a new patch that moves the resources_as_procedures() calls into services.module, and adjusts the order of precedence to match the REST Server one. Still not tested.
Comment #5
gddComment #6
deviantintegral commentedI blindly tried the patch in #3 to 6.x-3.x-dev, and I can now call the system.get_variable() method successfully over xmlrpc. I'll give it a full review soon.
Comment #7
voxpelli commentedJust looking at the code it seems like a good patch - except for:
There should be some spaces between the . and ' ;)
The order of precedence is not preserved here - right? Either we need to reverse the loop or we need to check that the method hasn't actually been set.
Powered by Dreditor.
Comment #8
ygerasimov commentedPatch works. I have written test to call action without prefix after applying this patch. You can see it in #1072844: XMLRPC server. All possible calls get listed in system.listMethods. BTW when I was writing the test without this patch applied I was not able to call action with prefix. So this functionality looks broken anyway.
Comment #9
voxpelli commented@ygerasimov: Do you test that order of precedence is correct?
Comment #10
ygerasimov commented@voxpelli no I don't. But in order to do that I need to create test resource and enable it. Do you think whether it is reasonable to do?
Comment #11
voxpelli commentedA test resource sounds reasonable I think.
Comment #12
ygerasimov commentedI have added test resource and precedence test to http://drupal.org/node/1072844#comment-4143538
Comment #13
gddOK this has been committed.
Comment #14
gddKyle pointed out this needs to be ported
Comment #15
voxpelli commented@heyrocker: Did you fix my feedback in #7?
Comment #16
kylebrowning commented