XML-RPC interface (was: Will GnuCash ever work for me?)

Jeb Bateman jeb@ocha.net
Tue, 25 Sep 2001 01:18:44 -0700


On Mon, Sep 24, 2001 at 07:56:03PM -0500, Linas Vepstas wrote:
> I'm curious to hear what Jeb means by 'arbitrary front-ends', as it
> must certainly differ from the vision I had of gnucash as a kind of
> 'applet' that can be embedded onto web pages.

Having a CGI interface does give you the ability to run GnuCash from a
web page, (which is great); but having an XML-RPC interface also gives
you that, plus a lot more capability because any program written in
any language with an XML-RPC client library can then drive GnuCash.

So, for example, I might want to enter some transactions from emacs.
I think there is some XML-RPC client elisp code around, but if not I
could probably write it...  Using that, I'd write an elisp function
called gnucash-add-transaction (or something) which would prompt me
for the Date, Description, Account, and Amount; and then hand that
data off to an XML-RPC function to process.

Or maybe I want to enter transactions from my WAP enabled cell phone.
I write a little CGI script in Python, which presents a simple web
form to enter the Date, Description, Account, and Amount.  Submit, and
it hands the input data off to its XML-RPC client library for
processing.  (Same thing for a regular web page, except it could
probably have a have a more verbose layout than the WAP version.)

As Bill mentioned, a Java client can be written too, (which probably
gives you a native looking GUI interface on multiple platforms ;-)

Anyway, I haven't actually done any XML-RPC hacking myself, but I was
involved in the community where it was developed, (before giving up on
Frontier and switching to GNU/Linux), and recently noticed an O'Reilly
book has been published about it.  I remember one of the original
arguments was that you could use CGI to solve the same problems.  

At the time, i liked that theory, and continued to work on CGIs
myself; but now I see that you have more client options with an
XML-RPC interface, since (I think) over 40 languages have client
libraries now.  Also the programming interface is natural, since it
just maps to function calls, and doesn't depend on sending input to a
fragile CGI script, which returns output in a fragile HTML layout.

Hope that helps,

-jeb