Very basic RPC::XML - passing arguments

Discussion in 'Perl Misc' started by Chris Plumber, Feb 4, 2004.

  1. I cant get RPC::XML to pass arguments to the invoked function on the server.
    Can anyone tell me what I am doing wrong?

    ------- server.pl --------

    use RPC::XML::Server;
    my $srv = new RPC::XML::Server (host => 'localhost', port => 9000);
    $srv->add_method( "local.test1.xpl" );
    $srv->server_loop;

    ------- local.test1.xpl -------

    <?xml version="1.0"?>
    <!DOCTYPE methoddef SYSTEM "rpc-method.dtd">
    <methoddef>
    <name>local.test1</name>
    <version>1.1</version>
    <signature>string</signature>
    <code language="perl">
    <![CDATA[
    #!/usr/bin/perl
    sub test1
    {
    return uc( $_[0] );
    }
    __END__
    ]]></code>
    </methoddef>

    ------ client.pl --------

    use Data::Dumper;
    require RPC::XML;
    require RPC::XML::Client;
    $cli = RPC::XML::Client->new('http://localhost:9000/RPCSERV');
    $resp = $cli->send_request( "local.test1", "Hello world" );
    print Dumper( $resp );

    ----------------------------------------------

    When I run this lot, I get the following from the client...

    $VAR1 = bless( {
    'faultString' => bless( do{\(my $o = 'method local.test1
    nas no matching signature for the argument list')}, 'RPC::XML::string' ),
    'faultCode' => bless( do{\(my $o = '301')},
    'RPC::XML::int' )
    }, 'RPC::XML::fault' );
    Chris Plumber, Feb 4, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pere Montolio

    XML RPC to ONC XDR RPC

    Pere Montolio, Aug 11, 2004, in forum: XML
    Replies:
    0
    Views:
    711
    Pere Montolio
    Aug 11, 2004
  2. Peter

    Very very very basic question

    Peter, Feb 8, 2005, in forum: C Programming
    Replies:
    14
    Views:
    512
    Dave Thompson
    Feb 14, 2005
  3. Ymtrader
    Replies:
    1
    Views:
    579
    Adam Tauno Williams
    Mar 15, 2011
  4. Shirish Joshi

    Ruby and Sun-RPC or ONC-RPC ?

    Shirish Joshi, Apr 7, 2004, in forum: Ruby
    Replies:
    0
    Views:
    185
    Shirish Joshi
    Apr 7, 2004
  5. Vladimir Konrad

    rpc (not xml-rpc)

    Vladimir Konrad, Sep 2, 2005, in forum: Ruby
    Replies:
    5
    Views:
    131
    Austin Ziegler
    Sep 3, 2005
Loading...

Share This Page