douxun2023 2012-08-11 21:31
浏览 47

不接受Python WSDL函数参数

I can send function arguments to a SOAP client in PHP like this (searchLinks is a method name):

$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'));

If I want to do the same thing in Python, how can I do this? This is the present code:

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

When I try to run this Python script, it throws errors. Why is it not taking function parameters like in PHP?

  • 写回答

1条回答 默认 最新

  • dongzipu7517 2012-08-11 23:03
    关注

    Which library are you using,

    Assuming that you are using SOAPpy, You can do .

    #!/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'})
    
    评论

报告相同问题?

悬赏问题

  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100