Here are examples in Python, Perl and Ruby - run them piped together like this:
./xmlrpc.py | ./xmlrpc.pl | ./xmlrpc.rb
Could XML-RPC offer the marshalling standard that REST is looking for?
Python:
import xmlrpclib
orwell={'1': 'All languages are equal'}
print xmlrpclib.dumps(tuple([orwell]),methodresponse=1)
Perl (needs SOAP-Lite):
use XMLRPC::Lite;
undef $/; $package = <>;
$data = XMLRPC::Deserializer->deserialize($package);
@args = $data->valueof("params");
%orwell=%{$args[0][0]};
$orwell{'2'}='But some languages are more equal than others';
print XMLRPC::Serializer->envelope('response', 'null',\%orwell);
Ruby:
require "xmlrpc/marshal"
depacket = XMLRPC::Marshal.load(STDIN.gets)
for key in depacket.keys()
puts depacket[key]
end