首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >来自Python / Perl的XML-RPC和Continuum

来自Python / Perl的XML-RPC和Continuum
EN

Stack Overflow用户
提问于 2009-01-20 16:27:39
回答 2查看 1K关注 0票数 2

有没有人成功地使用Python或Perl通过Xml-rpc获取数据...?

我使用的是continuum.py库:

代码语言:javascript
复制
#!/usr/bin/env python

from continuum import *

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

或者:

代码语言:javascript
复制
#!/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

有谁表现得更好吗...?

EN

回答 2

Stack Overflow用户

发布于 2009-01-21 09:59:58

是的..。使用Perl。

我用过XML::RPC。实际上,我编写了CPAN模块WWW::FreshMeat::API,使用它来访问Freshmeats XML-RPC,所以我知道它工作得很好!

将XML::RPC与鲜肉一起使用“系统.*”调用对我来说是有效的....

代码语言:javascript
复制
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 );

给我..。

代码语言:javascript
复制
$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'
      ];

希望这能有所帮助。

票数 1
EN

Stack Overflow用户

发布于 2009-01-31 10:11:12

您所描述的内容不是客户端库的一部分,而是服务器是否实现这些方法的问题。

我是XML模块的作者,在我提供的服务器类中,我还提供了基本“内省”RPC::XML的实现,它已经成为XML领域中的一种半标准。但即便如此,server类的用户也可能选择不激活自省API。

当然,我不能谈论其他XML-RPC实现。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/462038

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档