不接受 Python WSDL 函数参数


Python WSDL function parameters are not accepted

我可以像这样将函数参数发送到PHP中的SOAP客户端(searchLinks是一个方法名):

$client = new SoapClient("https://linksearch.api.cj.com/wsdl/version2/linkSearchServiceV2.wsdl",   array('trace'=> true));
$results = $client->searchLinks(array("developerKey" => $developerKey,
                                             "token" => '',
                                         "websiteId" => $websiteId,
                                     "advertiserIds" => 'joined'));

如果我想在 Python 中做同样的事情,我该怎么做?这是当前的代码:

server=WSDL.Proxy(url)
results=server.searchLinks({'developerkey':dev_key,'token':'','websiteId':website_id,'advertiserIds':'joined'})

当我尝试运行这个 Python 脚本时,它会抛出错误。为什么它不像 PHP 那样采用函数参数?

你使用的是哪个库,

假设您使用的是 SOAPpy,您可以执行 .

#!/usr/bin/python
import SOAPpy
url= 'https://linksearch.api.cj.com/wsdl/version2/linkSearchServiceV2.wsdl'
proxy = SOAPpy.WSDL.Proxy(url)
results=proxy.searchLinks({'developerkey': 'dev_key','token':'','websiteId': 'website_id','advertiserIds':'joined'})