I can successfully make an RPC method call with Jabber::RPC::Client but I would rather use Net::Jabber::Client but the authorization seems to fail. Any ideas?
Using Jabber::RPC::Client
use Jabber::RPC::Client;
my $client = Jabber::RPC::Client->new(server=>'localhost',
identauth=>'emsng:emsng',
endpoint=>'dst@localhost/XMLRPC', );
my $response = $client->call('CreateContext', {
ApplicationName=>'EMSng',
MaxIdleDuration=>'5' } );
print $response || $client->lastfault, "\n";
Using Net::Jabber::Client
use Net::Jabber qw( Client );
my $client = Net::Jabber::Client->new();
my $status;
$client->Connect(hostname=>'localhost');
if($client->Connected()) {
$status = $client->AuthSend(username=>'emsng',
password=>'emsng');
my @response =
$client->RPCCall(to=>'dst@localhost/XMLRPC',
methodname=>'CreateContext',
params=>[ {
ApplicationName=>'EMSngTEST',
MaxIdleDuration=>'5' } ] );
die Dumper(\@response);
}
Response when use Net::Jabber::Client
CreateContext MaxIdleDuration 5 Ap plicationName EMSngTEST
perlmonks.org content © perlmonks.org and bfaist, duckyd
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03