1

我可以像这样在 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 那样采用函数参数?

4

1 回答 1

0

您使用的是哪个库,

假设您使用的是 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'})
于 2012-08-11T23:03:42.113 回答