Net::Jabber RPCCall
bfaist
created: 2006-03-02 09:03:26

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
CreateContextMaxIdleDuration5Ap plicationNameEMSngTEST
Re: Net::Jabber RPCCall
created: 2006-03-02 15:28:55
Not terribly specific to Jabber RPC, but I'd say to dump your requests and see how they differ. If you were submitting identical requests, you'd sure hope to see identical responses.
Re: Net::Jabber RPCCall
created: 2006-03-09 14:25:27
The answer was to use $client->AuthIQAuth() instead of $client->AuthSend(). Connecting with SASL did not work so used old method (AuthIQAuth) instead.

perlmonks.org content © perlmonks.org and bfaist, duckyd

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03