Been in need of a “serious” XML-RPC client/server implementation for PHP so did some work on Simon Wilson’s Incutio XML-RPC library. Here’s a beta...

Streaming XML-RPC...

1)

There’s quite a few XML-RPC libraries for PHP (including the “grandfather of all” XML-RPC implementations - the Useful Inc library now maintained at http://pear.php.net/XML_RPC) but have had “issues” with all I’ve worked with, from things like excessive use of globals and inefficient use of PHP as a dynamically typed langauge (requiring boring hand coding of XML-RPC types) to poor error handling, lack of support for XML-RPC extensions and limitations in the extensibility of the design. Such is the way with Open Source.

Why XML-RPC and not SOAP? I’m having a renaissance, tired of SOAP bloat. Much of the “glory” of SOAP is really thanks to WSDL. On a side note (as in feature to be added) what surprises me is I’ve yet to see (may be I missed it) any of the PHP XML-RPC implementations using the same approach - use the system.listMethods call to automatically generate a specific client for an XML-RPC service - it’s been done by the xmlrpc-c library and would make XML-RPC really easy to work with...

Anyway - my favorite PHP XML-RPC implementation is Simon Wilson's Incutio XML-RPC Library for PHP because it makes great use of reflection plus supports most of the XML-RPC spec extensions (most importantly, system.multiCall).

There’s a few things it was missing for my needed which I’ve slowly been adding over time. Apologies to Simon who’s not aware (until now) I’ve been hacking. Got the impression he’s occupied with other things and feel it’s in the spirit of the license to release this (also time is short). Here’s what’s changed;

  • The client now uses an extension HTTP client library - PEAR::HTTP_Request. This allows you do do things like Basic HTTP authentication and requests through proxy servers.<br /><br />
  • The XML parser implementation now uses PEAR::XML_SaxFilters (thanks to Marcus Baker for the idea). This allows you to apply your own filters both on the server and client side to the request / response XML streams (respectively). Because XML_SaxFilters is applied to the XML <i>steam</i>, it means calls to a filter you write are made as the document is being parsed (and in this case, while the remote server is still sending it’s response.<br /><br />

PEAR::HTML_ProgressExpatXML_HTMLSaxPEAR::SOAPcall_user_func_array

Anyway - the code is packaged with PEAR, meaning you can use the PEAR Package Manager to install it - just type;

pear install IXR-2.0.tgz

It will harass you for the packages it relies upon. There’s no guarantees (I haven’t had time for unit tests) - there’s probably some bugs I haven’t found and please don’t harass me with change requests - I may make further releases but no promises. Still - perhaps it’s useful to someone.


develop/xmlrpc_progress.txt · Last modified: 2005/10/15 21:47