aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/share/perl/grid.cgi
blob: cf1550f005e4562a644890e8a8aeb886b196e332 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl -w

use strict;
use Carp;
use XML::RPC;
use MyCGI;
use OpenSim::Utility;
use OpenSim::GridServer;

my $param = &MyCGI::getParam();
my $request = $param->{'POSTDATA'};
#&OpenSim::Utility::Log("grid", "request", $request);
my $xmlrpc = new XML::RPC();
my $response = $xmlrpc->receive($request, \&XMLRPCHandler);
#&OpenSim::Utility::Log("grid", "response", $response);
&MyCGI::outputXml("utf-8", $response);

sub XMLRPCHandler {
    my ($methodname, @param) = @_;
    my $handler_list = &OpenSim::GridServer::getHandlerList();
    if (!$handler_list->{$methodname}) {
	Carp::croak("?");
    } else {
	my $handler = $handler_list->{$methodname};
	$handler->(@param);
    }
}