[system] / trunk / xmlrpc / apache_xmlrpc_services / dispatch.pl Repository:
ViewVC logotype

View of /trunk/xmlrpc/apache_xmlrpc_services/dispatch.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 279 - (download) (as text) (annotate)
Fri May 17 21:44:04 2002 UTC (17 years, 4 months ago) by gage
File size: 1194 byte(s)
Experimental xmlrpc WeBWorK webservices

    1 #!/usr/local/bin/perl -w
    2 
    3 
    4 use lib '/u/gage/xmlrpc/daemon/';
    5 use Webwork;
    6 
    7 sub echo {
    8     return shift;
    9 }
   10 
   11 sub listLib {
   12     my $in = shift;
   13     return( Webwork::listLib($in) );
   14 }
   15 sub renderProblem {
   16     my $in = shift;
   17     return( Webwork::renderProblem($in) );
   18 }
   19 sub readFile {
   20     my $in = shift;
   21     return( Webwork::readFile($in) );
   22 }
   23 sub hello {
   24   print "Receiving request for hello world\n";
   25   return "Hello world?";
   26 }
   27 
   28 sub pretty_print_rh {
   29   my $rh = shift;
   30   my $out = "";
   31   my $type = ref($rh);
   32   if ( ref($rh) =~/HASH/ ) {
   33     foreach my $key (sort keys %{$rh})  {
   34       $out .= "  $key => " . pretty_print_rh( $rh->{$key} ) . "\n";
   35     }
   36   } elsif ( ref($rh) =~ /SCALAR/ ) {
   37     $out = "scalar reference ". ${$rh};
   38   } elsif ( ref($rh) =~/Base64/ ) {
   39     $out .= "base64 reference " .$$rh;
   40   } else {
   41     $out =  $rh;
   42   }
   43   if (defined($type) ) {
   44     $out .= " type = $type \n";
   45   }
   46   return $out;
   47 }
   48 
   49 sub tth {
   50   my $in = shift;
   51   my $tthpath = "/usr/local/bin/tth";
   52     # $tthpath -L -f5 -r 2>/dev/null " . $inputString;
   53     return $in;
   54 
   55 }
   56 
   57 $map = {
   58   echo      =>  \&echo,
   59   listLib     =>  \&listLib,
   60   renderProblem =>  \&renderProblem,
   61   readFile    =>  \&readFile,
   62   hello     =>  \&hello,
   63   tth     =>  \&tth
   64 };
   65 
   66 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9