views:

474

answers:

2

Hi,

Has anyone had any success with getting data via Xml-rpc using Python or Perl...?

I'm using the continuum.py library:

#!/usr/bin/env python

from continuum import *

c = Continuum( "http://localhost:8080/continuum/xmlrpc" )

or:

#!/usr/bin/perl

use Frontier::Client;

my $url = "http://dev.server.com:8080/continuum/xmlrpc";

my $client = RPC::XML::Client->new($url);

my $res = $client->send_request('system.listMethods');

print "   Response class = ".(ref $res)."\n";
print "   Response type = ".$res->type."\n";
print "   Response string = ".$res->as_string."\n";
print "   Response value = ".$res->value."\n";

Gives "No such handler: system.listMethods"...

Anyone fared any better...?

Thanks...!

J

+1  A: 

Yes... with Perl.

I've used XML::RPC. In fact I wrote the CPAN module WWW::FreshMeat::API using it to access Freshmeats XML-RPC API so I know it does work well!

Using XML::RPC with Freshmeat the "system.*" calls work for me....

use XML::RPC;
use Data::Dumper;

my $fm = XML::RPC->new( 'http://freshmeat.net/xmlrpc/' );

# need to put in your Freshmeat username/password here
my $session = $fm->call( 'login', { username => 'user', password => 'pass' });

my $x = $fm->call('system.listMethods');

say Dumper( $x );

Gives me....

$VAR1 = [
        'system.listMethods',
        'system.methodHelp',
        'system.methodSignature',
        'system.describeMethods',
        'system.multiCall',
        'system.getCapabilities',
        'publish_release',
        'fetch_branch_list',
        'fetch_project_list',
        'fetch_available_licenses',
        'fetch_available_release_foci',
        'fetch_release',
        'login',
        'logout',
        'withdraw_release'
      ];

Hope that helps.

/I3az/

draegtun
A: 

What you describe is not part of the client-side library-- it's a matter of whether the server implements these methods.

I'm the author of the RPC::XML Perl module, and in the server class I provide I also provide implementation of the basic "introspection" API that has become a sort of semi-standard in the XML-RPC arena. But even then, users of the server class may choose to not have the introspection API activate.

Of course, I can't speak to other XML-RPC implementations.

rjray