-2

Hi I'm trying to connect to a WebService with python. I have the Php documentation , but i couldn't convert to python.

I have tried suds package like below

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

here is the Php documentation:

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

How can i convert the php code to python? specifically how can i call "getTopup" in python?

when i try the following code:

print(client.service.getTopup())

result is:

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

Thanks

Amir.S
  • 719
  • 8
  • 15
  • Have you researched about how to consume a service in python? It's the first step to go about this. Then come back here if having issues with your python code. – dcg Jun 25 '19 at 03:36
  • yes i have searched , and done some examples too , but in this specific example i have problem with call(getTopup...) – Amir.S Jun 25 '19 at 03:39
  • Then post the part you are having trouble with, so the community can actually help you. – dcg Jun 25 '19 at 03:41
  • how to call getTopup in pyhton – Amir.S Jun 26 '19 at 02:21

1 Answers1

0

it was "suds" problem , I am using Zeep(Python SOAP client) now , and it's working.

Thanks.

Amir.S
  • 719
  • 8
  • 15