Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- encoding: utf-8 -*-
- import datetime
- from hashlib import sha1
- import zeep
- from zeep import xsd
- from pprint import pprint
- SHOP_NAME = ""
- PANEL_LOGIN = ""
- PANEL_PASS = ""
- def hash_password():
- return sha1(datetime.datetime.today().strftime('%Y%m%d').encode('utf-8') + sha1(PANEL_PASS.encode('utf-8')).hexdigest().encode('utf-8')).hexdigest()
- # print(str(hash_password()))
- wsdl=('http://xxx.iai-shop.com/api/?gate=products/getDescriptions/64/soap/wsdl&lang=pol')
- client = zeep.Client(wsdl)
- auth_type = client.get_type('ns0:authenticateType')
- auth = auth_type('michal', hash_password())
- productsIdentsType_type = client.get_type('ns0:productsIdentsType')
- pit_type = client.get_type('ns0:productIdentType')
- pit = (pit_type('id', 333233))
- parms_type = client.get_type('ns0:paramsType')
- parms = parms_type(pit)
- req = {
- 'authenticate': auth,
- 'params': parms,
- }
- print(req)
- with client.options(raw_response=True):
- res = client.service.getDescriptions(req)
- # Print out text from Requests response object returned
- print(res.content)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement