sub doCommand {
# Decode the results of the raw command from XML.
my ($uri, $coder, @rest) = @_;
my $encoded = doRawCommand($uri, $coder, @rest);
return $encoded if ($encoded eq "");
my $result;
# Decode XML RPC wrapper case.
my $decoded = $coder->decode($encoded);
# Note: the result is an array ref with params inside
$result = $decoded->{value}[0];
return $result;
}
####
use strict;
use Frontier::RPC2;
my $coder = Frontier::RPC2->new(use_objects => 1);
my $result = [ "you guessed", 42 ];
my $xml_string = $coder->encode_response($result);
print $xml_string,"\n";
##
##
you guessed42