[system] / trunk / xmlrpc / RPC / RPC-XML-0.25 / methods / methodSignature.code Repository:
ViewVC logotype

View of /trunk/xmlrpc/RPC/RPC-XML-0.25/methods/methodSignature.code

Parent Directory Parent Directory | Revision Log Revision Log


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

    1 ###############################################################################
    2 #
    3 #   Sub Name:       methodSignature
    4 #
    5 #   Description:    Retrieve the list of method signatures for the specified
    6 #                   methods.
    7 #
    8 #   Arguments:      NAME      IN/OUT  TYPE      DESCRIPTION
    9 #                   $srv      in      ref       Server object instance
   10 #                   $arg      in      ref/sc    Listref or scalar specification
   11 #
   12 #   Globals:        None.
   13 #
   14 #   Environment:    None.
   15 #
   16 #   Returns:        Success:    listref
   17 #                   Failure:    fault object
   18 #
   19 ###############################################################################
   20 sub methodSignature
   21 {
   22     use strict;
   23 
   24     my $srv = shift;
   25     my $arg = shift;
   26 
   27     my $name = $srv->{method_name};
   28     my @list = (ref $arg) ? @$arg : ($arg);
   29     my (@results, $list);
   30 
   31     # Exclude any that are hidden from introspection APIs
   32     @list = grep(! $srv->{__method_table}->{$_}->{hidden}, @list);
   33     for (@list)
   34     {
   35         if ($srv->{__method_table}->{$_})
   36         {
   37             $list = $srv->{__method_table}->{$_}->{signature};
   38             push(@results, [ @$list ]);
   39         }
   40         else
   41         {
   42             return RPC::XML::fault->new(302, "$name: Method $_ unknown");
   43         }
   44     }
   45 
   46     return (ref $arg) ? \@results : $results[0];
   47 }

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9