grid.cgi 687 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/perl -w
  2. use strict;
  3. use Carp;
  4. use XML::RPC;
  5. use MyCGI;
  6. use OpenSim::Utility;
  7. use OpenSim::GridServer;
  8. my $param = &MyCGI::getParam();
  9. my $request = $param->{'POSTDATA'};
  10. #&OpenSim::Utility::Log("grid", "request", $request);
  11. my $xmlrpc = new XML::RPC();
  12. my $response = $xmlrpc->receive($request, \&XMLRPCHandler);
  13. #&OpenSim::Utility::Log("grid", "response", $response);
  14. &MyCGI::outputXml("utf-8", $response);
  15. sub XMLRPCHandler {
  16. my ($methodname, @param) = @_;
  17. my $handler_list = &OpenSim::GridServer::getHandlerList();
  18. if (!$handler_list->{$methodname}) {
  19. Carp::croak("?");
  20. } else {
  21. my $handler = $handler_list->{$methodname};
  22. $handler->(@param);
  23. }
  24. }