【问题标题】:XML-RPC and Continuum from Python / PerlPython / Perl 的 XML-RPC 和 Continuum
【发布时间】:2009-01-20 16:27:39
【问题描述】:

有没有人使用 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

有人过得更好吗...?

【问题讨论】:

    标签: python perl xml-rpc continuum


    【解决方案1】:

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

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

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

    【讨论】:

      【解决方案2】:

      是的……使用 Perl。

      我用过XML::RPC。事实上,我编写了 CPAN 模块 WWW::FreshMeat::API 使用它来访问 Freshmeats XML-RPC API,所以我知道它运行良好!

      将 XML::RPC 与 Freshmeat 一起使用,“system.*”调用对我有用....

      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'
            ];
      

      希望对您有所帮助。

      【讨论】:

        猜你喜欢
        • 2011-08-17
        • 1970-01-01
        • 2010-12-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-09-04
        • 1970-01-01
        相关资源
        最近更新 更多