python中的wsdl问题(将php转换为python)

2024-09-28 20:59:40 发布

您现在位置:Python中文网/ 问答频道 /正文

嗨,我正在尝试用python连接到Web服务。 我有Php文档,但无法转换为python

我试过下面这种肥皂水包装

from suds.client import Client
url = "http://newwebservice.esaj.ir/api/topup"

以下是Php文档:

$client = new nusoap_client('http://newwebservice.esaj.ir/api/topup', 'wsdl');
$res = $client->call('getTopup',['username','pass','phone number','price','product','order_id','type','profile_id','ext_id']) ;
print_r($res) ;

如何将php代码转换为python? 具体来说,如何在python中调用“gettoup”

当我尝试以下代码时:

print(client.service.getTopup())

结果是:

AttributeError: 'NoneType' object has no attribute 'promotePrefixes'

谢谢


Tags: 代码文档clientapiidhttpirservice