PDA

View Full Version : XML-RPC interface



Jacob Potter
2005-07-26, 12:59
Hi all -

I put together a plugin that provides an XML-RPC interface to
SlimServer. At the moment it only exposes
Slim::Control::Command::execute, but that alone is enough to provide
almost the same functionality as the CLI. I'll work on providing a
less cumbersome way to query the DB and current playlist later.

The plugin implementation works fine
(http://server:9000/plugins/RPC/rpc.xml), but I'm wondering if it
should be implemented as part of the server core itself. It's pretty
simple, simply running the request through the RPC::XML CPAN module
and passing the call to Slim::Control::Command::execute, then encoding
and sending the response. I also had to make a 2-line change to
Slim/Web/HTTP.pm to make it accept POST requests.

Should I post the plugin on the list? Go ahead and check it in to
trunk? Or would it be better to rewrite it as part of the Slim::Web::
stuff?

- Jacob

kdf
2005-07-26, 13:15
my feelings...the server is already going in more directions that I can count. I
think unless its a case of a significant amount of users needing it, starting
another new direction is only goig to make things worse. I mean, if it is
working as a plugin, that should be good enough if only a few need it.

Am I missing some benefits of having this implementation? Does is clean up an
existing problem? It is rather hard to think lately...with all the noise of
these lists.

I'd still certainly post the plugin here, with a few lines explaining what it
offers.

-kdf

Jacob Potter
2005-07-26, 15:43
On 7/26/05, kdf <slim-mail (AT) deane-freeman (DOT) com> wrote:
> Am I missing some benefits of having this implementation? Does is clean up an
> existing problem? It is rather hard to think lately...with all the noise of
> these lists.

The goal would be to replace the current hodgepodge of nonstandard,
skin-specific XML that ExBrowse2 and Default2 are based on. A standard
RPC-style interface would be much easier to test, debug, etc., and
would be a lot more versatile.

I'm sure you've seen the reliability problems that people are having
with ExBrowse2. It usually works for me, but it seems like the code
there is very brittle. Sometimes it cooperates, sometimes it doesn't.
Going through the standard skin/Template Toolkit system for what is
basically RPC is very non-optimal.

Here's the patch, along with a little test script.

- Jacob

Jacob Potter
2005-07-28, 16:09
Any comments, anyone? Should I go ahead and check the plugin in to trunk?

On 7/26/05, Jacob Potter <jacobdp (AT) gmail (DOT) com> wrote:
> (snipped)
> Here's the patch, along with a little test script.
>

Dan Sully
2005-07-28, 16:14
* Jacob Potter shaped the electrons to say...

>Any comments, anyone? Should I go ahead and check the plugin in to trunk?

Yes - I think so. The changes to the core are minimal (and useful), and we're
thinking that with this, it might be useful to remove the XML 'skin'

Were you planning on checking in RPC::XML, or forcing the user to?

-D
--
Ya gotta love UNIX, where else do you wonder whether
you can kill a zombie spawned by a daemon's fork?

Jacob Potter
2005-07-28, 16:32
On 7/28/05, Dan Sully <dan (AT) slimdevices (DOT) com> wrote:
> Were you planning on checking in RPC::XML, or forcing the user to?

I'll do it. The only major dependency is XML::Parser, which is already there.

- Jacob