-package FS::XMLRPC;
+ package FS::XMLRPC;
use strict;
-use vars qw( @ISA $DEBUG );
+use vars qw( $DEBUG );
use Frontier::RPC2;
# Instead of 'use'ing freeside modules on the fly below, just preload them now.
use FS::Record;
use FS::cust_main;
-@ISA = qw( );
+use Data::Dumper;
-$DEBUG = 1;
+$DEBUG = 0;
=head1 NAME
my ($method_name, $params) = (shift, shift);
- use Data::Dumper;
#die 'Called _serve without parameters' unless ref($params) eq 'ARRAY';
$params = [] unless (ref($params) eq 'ARRAY');
}
- warn Dumper(@result);
-
- if (grep { UNIVERSAL::can($_, 'hashref') ? 0 : 1 } @result) {
+ if ( scalar(@result) == 1 && ref($result[0]) eq 'HASH' ) {
+ return $result[0];
+ } elsif (grep { UNIVERSAL::can($_, 'hashref') ? 0 : 1 } @result) {
#warn "FS::XMLRPC: One or more objects returned from '${fssub}' doesn't " .
# "support the 'hashref' method.";
return [ $FS::VERSION ];
} # else...
- warn "Unhandle XMLRPC request '${method_name}'";
- return [];
+ warn "Unhandled XMLRPC request '${method_name}'";
+ return {};
}