You are here

system.methodSignature

g089h515r806 的头像
Submitted by g089h515r806 on 星期三, 2009-08-26 15:55

老葛的Drupal培训班 Think in Drupal

system.methodSignature

这个内置的Drupal XML-RPC方法返回一个数据类型的数组.列表中的第一个是函数返回值的数据类型;接着是给定方法所需的任意参数.例如, remoteHello.hello方法返回了一个字符串,并期望一个参数:一个包含了客户端名称的字符串.让我们调用system.methodSignature来看看Drupal是不是这样的.
 
// Get the method signature for our example method.
$signature = xmlrpc($url, 'system.methodSignature', 'remoteHello.hello');
 
果然, $signature的值变成了一个数组:('string', 'string').
 
system.methodHelp
这个内置的Drupal XML-RPC方法,返回xmlrpc钩子中定义的方法的描述.
 
// Get the help string for our example method.
$help = xmlrpc($url, 'system.methodHelp', 'remoteHello.hello');
 
$help的值现在是一个字符串: Greets XML-RPC clients by name.
 
system.getCapabilities
这个内置的Drupal XML-RPC方法描述了Drupal的XML-RPC服务器能力,这里根据实现的规格进行描述. Drupal实现了以下规格:
 
xmlrpc:
specVersion 1
 
faults_interop:
specVersion 20010516
 
system.multicall
specVerson 1
 
introspection
specVersion 1
 
system.multiCall
其它值得一提的内置方法就是system.multiCall了,它允许在一个HTTP请求中调用多个XML-RPC方法。关于这一个规定的更多信息(它没有包含在XML-RPC说明中),参看以下URL(注意这是一个字符串):http://web.archive.org/web/20060502175739/http:// www.xmlrpc.com/discuss/msgReader$1208

Drupal版本: