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