有没有人成功地使用Python或Perl通过Xml-rpc获取数据...?
我使用的是continuum.py库:
#!/usr/bin/env python
from continuum import *
c = Continuum( "http://localhost:8080/continuum/xmlrpc" )或者:
#!/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";给予:No such handler: system.listMethods
有谁表现得更好吗...?
发布于 2009-01-21 09:59:58
是的..。使用Perl。
我用过XML::RPC。实际上,我编写了CPAN模块WWW::FreshMeat::API,使用它来访问Freshmeats XML-RPC,所以我知道它工作得很好!
将XML::RPC与鲜肉一起使用“系统.*”调用对我来说是有效的....
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 );给我..。
$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'
];希望这能有所帮助。
发布于 2009-01-31 10:11:12
您所描述的内容不是客户端库的一部分,而是服务器是否实现这些方法的问题。
我是XML模块的作者,在我提供的服务器类中,我还提供了基本“内省”RPC::XML的实现,它已经成为XML领域中的一种半标准。但即便如此,server类的用户也可能选择不激活自省API。
当然,我不能谈论其他XML-RPC实现。
https://stackoverflow.com/questions/462038
复制相似问题