You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
698 B
30 lines
698 B
|
|
import requests
|
|
import suds.client
|
|
import suds_requests
|
|
|
|
|
|
def get_authenticated_client(base_url, cert, key):
|
|
cache_location = '/tmp/suds'
|
|
cache = suds.cache.DocumentCache(location=cache_location)
|
|
|
|
session = requests.Session()
|
|
session.cert = (cert, key)
|
|
return suds.client.Client(
|
|
base_url,
|
|
cache=cache,
|
|
transport=suds_requests.RequestsTransport(session)
|
|
)
|
|
|
|
|
|
def get_client(base_url):
|
|
cache_location = '/tmp/suds'
|
|
cache = suds.cache.DocumentCache(location=cache_location)
|
|
|
|
session = requests.Session()
|
|
|
|
return suds.client.Client(
|
|
base_url,
|
|
cache=cache,
|
|
transport=suds_requests.RequestsTransport(session)
|
|
)
|