module with XML RPC
Hello, I most probably will need to create a new module that needs to handle XML RPCalls. I have no experience with XML RPC, so I'd like to ask a few general questions about Drupal's implementation. If I understand well, the files includes/xmlrpc(s).inc are a fork from the library: http://scripts.incutio.com/xmlrpc/ How come the Drupal XML RPC API doesn't use any of the PHP XML RPC functions defined here: http://php.net/xmlrpc ? Is this a completely different implementation? Why? Is there a historical/technical reason behind this? How does a XML RPC "session" happen? During a page load, we can use php to query the DB, get a reply from the SQL server, process that reply and display the page according to the reply we got. Does the procedure happen remotely with XML RPC? I.e., if I have a drupal XML RPC client module, that needs to contact a remote XML RPC server, do I get a chance to send the call, get the reply and process that reply all within one page load, as if it were a SQL query? If not, how is the exchange of information handled. What modules exist that use XML RPC a lot, that I could study? How would a simple code snippet look like? (make a call to server, get reply, and have a if / else fork according to the reply we got - or display / print_r() the content of the reply). I saw a few handbook pages, and some issues about xml rpc, but I can't find any information for a total noob... Thanks, Augustin. -- http://www.wechange.org/ Because we and the world need to change. http://www.reuniting.info/ Intimate Relationships, peace and harmony in the couple.
If memory serves, it used to be that Drupal's xmlrpc library was adopted from another project (perhaps the one you pointed to). There was a rash of xmlrpc security problems in many CMS systems, including Drupal, so it was decided to rewrite this library in house (I think it was Dries). Check the cvs log for that file, it will be better than my memory. For examples, check the blogapi and drupal modules in core. On 8/31/06, Augustin (Beginner) <drupal.beginner@wechange.org> wrote:
Hello,
I most probably will need to create a new module that needs to handle XML RPCalls.
I have no experience with XML RPC, so I'd like to ask a few general questions about Drupal's implementation.
If I understand well, the files includes/xmlrpc(s).inc are a fork from the library: http://scripts.incutio.com/xmlrpc/
How come the Drupal XML RPC API doesn't use any of the PHP XML RPC functions defined here: http://php.net/xmlrpc ? Is this a completely different implementation? Why? Is there a historical/technical reason behind this?
How does a XML RPC "session" happen? During a page load, we can use php to query the DB, get a reply from the SQL server, process that reply and display the page according to the reply we got. Does the procedure happen remotely with XML RPC? I.e., if I have a drupal XML RPC client module, that needs to contact a remote XML RPC server, do I get a chance to send the call, get the reply and process that reply all within one page load, as if it were a SQL query? If not, how is the exchange of information handled.
What modules exist that use XML RPC a lot, that I could study?
How would a simple code snippet look like? (make a call to server, get reply, and have a if / else fork according to the reply we got - or display / print_r() the content of the reply).
I saw a few handbook pages, and some issues about xml rpc, but I can't find any information for a total noob...
Thanks,
Augustin.
Thanks to all who replied. With your help, I think I understand better how it works. You also gave me a lot module example for me to study during the next few weeks. I should be able to get by, now. :) Blessings, Augustin.
On 1-Sep-06, at 9:24 AM, Augustin (Beginner) wrote:
With your help, I think I understand better how it works. You also gave me a lot module example for me to study during the next few weeks. I should be able to get by, now. :)
I'm a little late to the thread - but blogapi.module (in core) is entirely XML-RPC based. Good luck! -- James Walker :: http://walkah.net/ :: xmpp:walkah@walkah.net
On 8/31/06, Augustin (Beginner) <drupal.beginner@wechange.org> wrote:
How come the Drupal XML RPC API doesn't use any of the PHP XML RPC functions defined here: http://php.net/xmlrpc ? Is this a completely different implementation? Why? Is there a historical/technical reason behind this?
Well it's an extension and we can't depend on it being installed on most servers. That and the warning on the PHP site says it all: "This extension is EXPERIMENTAL. The behaviour of this extension -- including the names of its functions and anything else documented about this extension -- may change without notice in a future release of PHP. Use this extension at your own risk."
How does a XML RPC "session" happen?
As far as I know it's state-less, if you want sessions you'll need to write those.
I.e., if I have a drupal XML RPC client module, that needs to contact a remote XML RPC server, do I get a chance to send the call, get the reply and process that reply all within one page load, as if it were a SQL query?
Yes, it's just a function call.
What modules exist that use XML RPC a lot, that I could study?
How would a simple code snippet look like? (make a call to server, get reply, and have a if / else fork according to the reply we got - or display / print_r() the content of the reply).
I've done a bit with XML RPC in the station module. The archive and schedule sub-modules are desinged to run on different machines and grab program information remotely. The code is sort of scattered around but it's a working example. andrew
Hello Andrew, I've been using XML RPC a lot in my work. I'm implementing a bunch of modules to provide telephone access to Drupal websites (voicemail, audio announcements, audio groups, etc.) and I use XML-RPC to handle all the communication between the telephone/voip server and the Drupal site. You can have a look at a sample module that handles the upload/download/query of audio nodes here: http://drupal.org/node/43110 If you are interested, please get in touch with me outside the list and I'll send you the PHP .inc file that makes the XML-RPC calls to the above mentioned module. Good luck, Leo ----- Original Message ----- From: "andrew morton" <graveltech@gmail.com> To: <development@drupal.org> Sent: Thursday, August 31, 2006 4:21 PM Subject: Re: [development] module with XML RPC
On 8/31/06, Augustin (Beginner) <drupal.beginner@wechange.org> wrote:
How come the Drupal XML RPC API doesn't use any of the PHP XML RPC functions defined here: http://php.net/xmlrpc ? Is this a completely different implementation? Why? Is there a historical/technical reason behind this?
Well it's an extension and we can't depend on it being installed on most servers. That and the warning on the PHP site says it all: "This extension is EXPERIMENTAL. The behaviour of this extension -- including the names of its functions and anything else documented about this extension -- may change without notice in a future release of PHP. Use this extension at your own risk."
How does a XML RPC "session" happen?
As far as I know it's state-less, if you want sessions you'll need to write those.
I.e., if I have a drupal XML RPC client module, that needs to contact a remote XML RPC server, do I get a chance to send the call, get the reply and process that reply all within one page load, as if it were a SQL query?
Yes, it's just a function call.
What modules exist that use XML RPC a lot, that I could study?
How would a simple code snippet look like? (make a call to server, get reply, and have a if / else fork according to the reply we got - or display / print_r() the content of the reply).
I've done a bit with XML RPC in the station module. The archive and schedule sub-modules are desinged to run on different machines and grab program information remotely. The code is sort of scattered around but it's a working example.
andrew
Another example module is the new Query Exporter module (query_export.module) that's in contribute HEAD. I expose views via XMLRPC server handlers. It's actually pretty easy to do, since all you really need to do is register your handlers via hook_xmlrpc. The structure you pass back in the hook is a bit arcane, but if you read a few modules that use the hook, you'll figure it out. I also implement a sort of "session" variable that lets the xmlrpc client use drupal users for authentication. There may be a better way to do this than what I did in query_export.module, but what I did works pretty well for my particular application, and may work for you as well. Cheers, Rob Rob Thorne Torenware Networks andrew morton wrote:
On 8/31/06, Augustin (Beginner) <drupal.beginner@wechange.org> wrote:
How come the Drupal XML RPC API doesn't use any of the PHP XML RPC functions defined here: http://php.net/xmlrpc ? Is this a completely different implementation? Why? Is there a historical/technical reason behind this?
Well it's an extension and we can't depend on it being installed on most servers. That and the warning on the PHP site says it all: "This extension is EXPERIMENTAL. The behaviour of this extension -- including the names of its functions and anything else documented about this extension -- may change without notice in a future release of PHP. Use this extension at your own risk."
How does a XML RPC "session" happen?
As far as I know it's state-less, if you want sessions you'll need to write those.
I.e., if I have a drupal XML RPC client module, that needs to contact a remote XML RPC server, do I get a chance to send the call, get the reply and process that reply all within one page load, as if it were a SQL query?
Yes, it's just a function call.
What modules exist that use XML RPC a lot, that I could study?
How would a simple code snippet look like? (make a call to server, get reply, and have a if / else fork according to the reply we got - or display / print_r() the content of the reply).
I've done a bit with XML RPC in the station module. The archive and schedule sub-modules are desinged to run on different machines and grab program information remotely. The code is sort of scattered around but it's a working example.
andrew
participants (6)
-
andrew morton -
Augustin (Beginner) -
James Walker -
Khalid B -
Leo Burd -
Rob Thorne