0

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

Vito
  • 1,201
  • 1
  • 10
  • 16

1 Answers1

0

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)
alexanderlukanin13
  • 4,577
  • 26
  • 29