The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
###############################################################################
#
#   Sub Name:       methodSignature
#
#   Description:    Retrieve the list of method signatures for the specified
#                   methods.
#
#   Arguments:      NAME      IN/OUT  TYPE      DESCRIPTION
#                   $srv      in      ref       Server object instance
#                   $arg      in      ref/sc    Listref or scalar specification
#
#   Globals:        None.
#
#   Environment:    None.
#
#   Returns:        Success:    listref
#                   Failure:    fault object
#
###############################################################################
sub methodSignature
{
    use strict;

    my $srv = shift;
    my $arg = shift;

    my $name = $srv->{method_name};
    my @list = (ref $arg) ? @$arg : ($arg);
    my (@results, $list, $method);

    for (@list)
    {
        if (ref($method = $srv->get_method($_)) and (! $method->hidden))
        {
            push(@results,
                 [ map { [ split(/ /) ] } @{$method->signature} ]);
        }
        else
        {
            return RPC::XML::fault->new(302, "$name: Method $_ unknown");
        }
    }

    return (ref $arg) ? \@results : $results[0];
}