简体   繁体   中英

how consume via Suds a webservice that expose wsdl via https and service via http

I've a strange situation to solve (imho)

I've to consume a web service who has the wsdl via https and the service via http. How I can "switch" on-the-fly (in Suds) to http only for the service?

Thank's

You can write custom transport, but in your situation it's much simpler to download wsdl locally.

import requests
import suds    

r = requests.get(SERVICE_WSDL_HTTPS_URL)
with open('/tmp/service.wsdl', 'w') as file:
    file.write(r.text)
client = suds.client.Client('file:///tmp/service.wsdl', location=SERVICE_HTTP_URL)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM