Jabber::RPC::Client - Jabber-RPC Client
use Jabber::RPC::Client; # Client connects as Jabber client my $client = new Jabber::RPC::Client( server => 'myserver.org', identauth => 'user:password', endpoint => 'jrpc.myserver.org/rpc-server', ); my $result = $client->call('examples.getStateName', 5); print "getStateName: ", $result || $client->lastfault, "\n"; # Switch endpoints $client->endpoint('another@endpoint.org/resource'); # This time the call will go to the new endpoint my $result = $client->call('examples.getStateList', [12,13,14]); print "getStateList: ", $result || $client->lastfault, "\n";
Jabber::RPC::Client is an implementation of a Jabber-RPC client. A Jabber-RPC client sends XML-RPC-encoded calls carried over Jabber to an endpoint that is a Jabber::RPC::Server.
It uses the Frontier::RPC2 XML-RPC implementation to make the encoding and decoding calls.
The endpoint can either be a Jabber component or a Jabber client (see the SYNOPSIS examples for Jabber::RPC::Server) - specify the JID of the endpoint appropriately.
You can change the endpoint with the endpoint() function.
If you don't specify any value for a 'resource' argument, a default of 'jrpc-client' will be used. Bear in mind that if you haven't specified a value for the 'resource' argument when starting the Jabber::RPC::Server, a default of 'jrpc-server' will be used there. Hence the endpoint of 'jrpc.myserver.org/rpc-server' in the synopsis example above.
early
DJ Adams
Jabber::RPC::Server, Jabber::Connection
To install Jabber::RPC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Jabber::RPC
CPAN shell
perl -MCPAN -e shell install Jabber::RPC
For more information on module installation, please visit the detailed CPAN module installation guide.