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. Advertisements

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:
    989
    Pere Montolio
    Aug 11, 2004
  2. Raymond Arthur St. Marie II of III

    very Very VERY dumb Question About The new Set( ) 's

    Raymond Arthur St. Marie II of III, Jul 23, 2003, in forum: Python
    Replies:
    4
    Views:
    731
    Raymond Hettinger
    Jul 27, 2003
  3. shanx__=|;-

    very very very long integer

    shanx__=|;-, Oct 16, 2004, in forum: C Programming
    Replies:
    19
    Views:
    2,062
    Merrill & Michele
    Oct 19, 2004
  4. Abhishek Jha

    very very very long integer

    Abhishek Jha, Oct 16, 2004, in forum: C Programming
    Replies:
    4
    Views:
    729
    jacob navia
    Oct 17, 2004
  5. Peter

    Very very very basic question

    Peter, Feb 8, 2005, in forum: C Programming
    Replies:
    14
    Views:
    829
    Dave Thompson
    Feb 14, 2005
  6. olivier.melcher

    Help running a very very very simple code

    olivier.melcher, May 12, 2008, in forum: Java
    Replies:
    8
    Views:
    2,798
  7. Ymtrader
    Replies:
    1
    Views:
    822
    Adam Tauno Williams
    Mar 15, 2011
  8. Vladimir Konrad

    rpc (not xml-rpc)

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