close
suds is going to be eliminated. here is a sample code for using python soap client:zeep. If you need.take it. I am not lucky. read many doc. those are no work. finally this one is OK.If you need, just try it. import json import requests import ssl import requests import traceback import json import pprint import urllib3 import datetime import os from zeep import Client from requests import Session from zeep.transports import Transport session = Session() session.verify = False transport = Transport(session=session) #from suds.client import Client requests.packages.urllib3.disable_warnings() urllib3.disable_warnings() from requests import Session from zeep.transports import Transport from zeep import Client DSM_USERNAME = "masteradmin" DSM_PASSWORD = "Apple2007" session = Session() #session.verify = False transport = Transport(session=session) client = Client(WSDLFile, transport=transport, strict=False) def nowStr(): return datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") def getdsmid(): WSDLFile="https://18.237.128.117:443/webservice/Manager?WSDL"
if hasattr(ssl, '_create_unverified_context'): ssl._create_default_https_context = ssl._create_unverified_context try: #Client.transport.session.verify = False _manager = Client(WSDLFile) client.authenticate(DSM_USERNAME, DSM_PASSWORD)
_manager.service,yourAPI()
文章標籤
全站熱搜
留言列表