What is xmlrpc.php file used for?

I have searched both Drupal.org and Google to find out what the xmlrpc.php file used for? The only thing I can find is the following statement:

    "PHP page for handling incoming XML-RPC requests from clients."

I have removed the xmlrpc.php from my site but I have numerous RSS feeds coming into my site. Is the xmlrpc.php file used for RSS feeds? Should I put the file back?

I heard in the past about security issues regarding this file. Should this file be moved out of the root directory to a subdirectory to avoid misuse from hackers?

Does anyone have a "non-technical" description of what the xmlrpc.php file is used for?

Thanks,

Sam308

Comments

I am unaware of any security

I am unaware of any security related issues with this file. removing is or storing it above the public root would seem to be to be unnecessary.

XML-RPC for Newbies

Inside every computer, every time you click a key or the mouse, thousands of "procedure calls" are spawned, analyzing, computing and then acting on your gestures.

For example, when you move your mouse over an icon, the computer calls a procedure, LocateMouse, to figure out what you're pointing at.

Is the mouse pointing at a menu? At a scroll bar? If so, which part of the scroll bar? Is it pointing at an icon? Or some text? Every possibility is considered.

OK, so let's say the mouse is pointing at an icon when you click the mouse button. What kind of icon is it? If it's a printer, call the procedure that prints things. What do you do when the user clicks the mouse on this kind of icon? A special procedure answers that question.

This is the kind of chatter that's going on inside your computer *all the time*, even when you aren't there. It's always asking questions. And the answers come from procedures. To get an answer, the software "calls" the procedure.

Parameters and returned values

Along with the call, the procedure might require some extra information, so it doesn't have to recompute things that other procedures might have already figured out. These are called "parameters".

The LocateMouse procedure might need to be told where the mouse is. The location of the mouse is usually expressed in a coordinate system like the Cartesian plane that you learned about in high school. An x coordinate and a y coordinate. Such a procedure would be said to "take" two parameters, an x and a y.

Parameters are important for three reasons. First, why do the work again when the caller probably already knows where the mouse is? And second, the mouse may have moved in the time it took to call the LocateMouse procedure. And third, a procedure may be called to do some computation, for example, to look up a record in a database. Such a procedure would require a user's name or account number as a parameter, to identify the record that's to be looked up.

And there's the motivation for the third part of a procedure call -- the returned value. It's the answer that the procedure sends back to the procedure that called it. A database-access procedure call might return a set of values, all the elements of the record indicated by the key identifier it received as a parameter.

What is a procedure call?

So, now we're ready to say, concisely, what a procedure call is.

A procedure call is the name of a procedure, its parameters, and the result it returns.

Why are procedure calls important? A very simple answer. Without them, there would be no computers!

Every program is just a single procedure called main, every operating system has a main procedure called a kernel. There's a top level to every program that sits in a loop waiting for something to happen and then distributes control to a hierarchy of procedures that respond. This is at the heart of interactivity and networking, it's at the heart of software.

What is RPC?

RPC is a very simple extension to the procedure call idea, it says let's create connections between procedures that are running in different applications, or on different machines.

Conceptually, there's no difference between a local procedure call and a remote one, but they are implemented differently, perform differently (RPC is much slower) and therefore are used for different things.

Remote calls are "marshalled" into a format that can be understood on the other side of the connection. As long as two machines agree on a format, they can talk to each other. That's why Windows machines can be networked with other Windows machines, and Macs can talk to Macs, etc. The value in a standardized cross-platform approach for RPC is that it allows Unix machines to talk to Windows machines and vice versa.

What is XML-RPC?

There are an almost infinite number of formats possible. One possible format is XML, a new language that both humans and computers can read. XML-RPC uses XML as the marshalling format. It allows Macs to easily make procedure calls to software running on Windows machines and BeOS machines, as well as all flavors of Unix and Java, and IBM mainframes, and PDAs and sewing machines (they have computers in them too these days).

With XML it's easy to see what it's doing, and it's also relatively easy to marshall the internal procedure call format into a remote format.

Why RPC is important

OK, now that we understand what XML-RPC is, let the XML part fade into the background. It's an implementation detail. Programmers are interested in XML, as are web developers, but if you're a user or an investor, XML is about as important as C++ or Java. The developers like it, or seem to, and that's the only major take-away from the XML part of XML-RPC.

But RPC is important, no matter what format is used, because it allows choices, you can replace a component with another one; and it opens possibilities, empowering advanced users to develop solutions with packaged software that the developers didn't anticipate.

the above is an excerpt from http://davenet.scripting.com/1998/07/14/xmlRpcForNewbies

Interesting reading

But I don't think you answered his question. What is that module for?

its not a module. its a file

its not a module. its a file in the core drupal download.

Does anyone have a "non-technical" description of what the xmlrpc.php file is used for?

answered above: but will place here for convience.

What is XML-RPC?

There are an almost infinite number of formats possible. One possible format is XML, a new language that both humans and computers can read. XML-RPC uses XML as the marshalling format. It allows Macs to easily make procedure calls to software running on Windows machines and BeOS machines, as well as all flavors of Unix and Java, and IBM mainframes, and PDAs and sewing machines (they have computers in them too these days).

With XML it's easy to see what it's doing, and it's also relatively easy to marshall the internal procedure call format into a remote format.

You have long memory

xmlrpc.php and everything else around it is safe since 2005 summer (4.6.3, 4.5.5) -- at this point I changed the ancient XML-RPC library to a much more modern and lot safer one. Since then we have not seen any XML-RPC secholes.

If you have a blogging client then that can issue XML-RPC requests so that you can create blog posts with that app. There are other, similar uses: when a program on another server wants to 'talk' to you, XML-RPC is one of the methods to do it.
--
The news is Now Public | Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.

--
Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.

Blogger api

If you wanted to post to your site remotely (using a desktop client, or from digg.com...) you'd need this. There are dozens of other uses... for example letting a Flash client do things with Drupal. Most likely, you're not using it.

- Robert Douglass

-----
Lullabot | My Drupal book | My Digg RSS feed

my Drupal book | Twitter | Senior Drupal Advisor, Acquia | Advisor ICanLocalize

Thanks for the discussion, but I need an answer

Thanks for spending the time to define XML-RPC. It was interesting reading.

Maybe now there are no security issues associated with the xmlrpc.php file, but I just need an answer to the following two questions.

In my original posting I asked:

(1) I have removed the xmlrpc.php from my site but I have numerous RSS feeds coming into my site. Is the xmlrpc.php file used for RSS feeds? Should I put the file back?

(2) I heard in the past about security issues regarding this file. Should this file be moved out of the root directory to a subdirectory to avoid misuse from hackers?

Thanks,

Sam308

Sam Raheb (Sam308)

Sigh

It has nothing to do with RSS. It is safe, no need to do anything.
--
The news is Now Public | Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.

--
Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.

So how do I use it?

I want to retrieve stuff from my Drupal site using XML-RPC, but I'm not sure how to go about it..

Is there a way to bring up a listing of all possible things I can query via XMLRPC, so I can use PHP to retrieve information...

Thanks..

Ben

Use cases

Wordpress and xmlrpc

I have a wordpress website which came with an xmlrpc.php file. I'm writing some cache-controls for different files. My understanding is that with wordpress the files of the txt of different pages withing a wordpress website are .php files. Obviouslu xmplrpc.php is also a .php file. If I set cache control for .php files (to keep the expiration for text short) won't the cache controlling advrsely affect the xmlrpc.php file? In other words in

<IfModule mod_headers.c>
<FilesMatch "\.(ico|jpg|jpeg|gif)$">
Header set Cache-Control "max-age=37440000"
</FilesMatch>
<FilesMatch "\.(css)$">
Header set Cache-Control "max-age=87000"
</FilesMatch>
<FilesMatch "\.(html|htm)$">
Header set Cache-Control "max-age=300"
</FilesMatch>
</IfModule>

If I add

<FilesMatch "\.(php)$">
Header set Cache-Control "max-age=300"
</FilesMatch>

It should keep the expiration of the text of a wordpress site to 300 seconds, but will this cache control code adversely affect how xmlrpc.php functions? What sort of effect will caching xmlrpc.php have?

Thanks,

Rex

Roscoe