Very basic RPC::XML - passing arguments

C

Chris Plumber

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' );
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top