usr bin env python coding utf-8 from suds client import Client user us

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from suds.client import Client
user = 'user'
password = 'password'
print user
print password
try:
auth_url = 'http://api.mainlink.ru/start.asmx?WSDL'
auth_client = Client(auth_url)
cookie = auth_client.service.sys_LogIn(Login=user, Password=password)
cookies = auth_client.options.transport.cookiejar
balance = auth_client.service.sys_Balance([])
print balance
except Exception as e:
print str(e)