Monday, September 15, 2008

Redstone XML-RPC Library

Came across this recently - looks like an interesting XML-RPC library implementation - see below for why I think it is interesting:

Redstone XML-RPC Library

First, the basics:

Redstone implements an XML-RPC client and an XML-RPC servlet that allows you to make plain Java objects XML-RPC enabled. Nothing very unusual there - Apache XML-RPC already has and allows all that.

Note: Redstone has an XML-RPC servlet class, but no inbuilt web server. So you have to use some external servlet container as a web server. But that should not be much of an issue in most cases, since there are several open source servlet containers like Apache Tomcat and Jetty.

The interesting bits about Redstone:



From the Redstone site:

"Both the client and the server can be configured to stream messages directly over a socket without constructing the messages in memory. Although this is not compliant with the specification (which mandates the use of a Content-Length HTTP header), this allows for virtually unlimited sized messages when communicating with services and clients that do not use or rely on the Content-Length header."

That ability to have "unlimited sized messages" could be useful for some applications ...

"A serialization framework allowing custom serializers to serialize values inherently unknown to the library."

Though XML-RPC supports basic data types like strings, integers, Binary, and also structs and arrays, it might be useful to have inbuilt support for other data types, and Redstone seems to have that - maybe with some work by the developer.

And finally:

"XML-RPC is perfectly suited to support basic AJAX functionality in web applications. The Redstone XML-RPC library contains a minimal XML-RPC client written in JavaScript that may be used to invoke XML-RPC services published using this library. The client is small due to the fact that it relies on a set of custom serializers supplied by the library that serializes return values from invocation handlers using the JSON notation. This means that XML-RPC messages are sent to the server whereas JSON messages are returned to the client which can be immediately evaluated to JavaScript objects:"

That last point is unusual but potentially useful too - the library can returns the XML-RPC method response as JSON instead of XML. That may make it more easy to use with JavaScript on the client side, since the response can be just evaluated to get the data into your JavaScript variables.

Of course, all the three points mentioned, make Redstone non-standard, so we'd have to evaluate whether it was appropriate or not to use it for any given work.

Vasudev Ram - Dancing Bison Enterprises

No comments: