Redstone - Simple and Compact Java XML-RPC library
Jon Moffet
Yesterday I had to look for a simple Java XML-RPC library in a simple proof of concept application.
Plainly speaking, I'm going to demonstrate XML-RPC concept to a bunch of friends who is unfamiliar with programming languages other than Java (but they are not 1337 programmers either!)
I'm looking for a simple library which isn't bloated with functionality and easy to use. After much surfing, I found Redstone XML-RPC Library.
Overall the library only size up to 44KB when zipped together and it can be use to either construct XML-RPC service or clients.
Compared to Apache XML-RPC, Redstone XML-RPC is much better suited for my use as a tool to introduce XML-RPC concept to a group of friend that never used it before.
To use it, you need to download XML-RPC library from Redstone project webpage first. Then mae appropriate adjustment to your CLASSPATH to include the Redstone library.
For this example, I use the XML-RPC API service which can be found at Foxrate.org: Currency Exchange website.
Here's the sample code that I use to demostrate XML-RPC to my friends :
-
import redstone.xmlrpc.*;
-
public class GetCurrency {
-
{
-
new GetCurrency();
-
}
-
-
//declare RPC object
-
XmlRpcClient client = new XmlRpcClient("http://foxrate.org/rpc/",true );
-
-
//
-
// invoke RPC call (3 parameter, rujuk atas)
-
//
-
// please check http://foxrate.org/ for list of currencies
-
//
-
XmlRpcStruct struct = (XmlRpcStruct)token;
-
-
-
-
//output
-
-
-
-
-
}
-
-
}
The simple code will perform conversion of USD 50 to MYR (Malaysian Ringgit) through the use of XML-RPC api.
You can download the Foxrate XML-RPC sample code here.
Note that Redstone XML-RPC library and the sample code requires Java 5 (Java 1.5.x) to compile and run.
Tags: xml-pc, redstone, apache, php, foxrate, currency exchange
Posted in Uncategorized |








November 12th, 2008 at 4:51 pm
August 7th, 2009 at 9:57 pm
steessobturse
Bwog
broadabrixkiz
af5g