Commit 2dcabc49 authored by alex zhang's avatar alex zhang

Allows a user to get a client with custom Plugins

parent 20bd0ecb
Pipeline #15584652 failed with stage
in 2 minutes and 17 seconds
......@@ -46,13 +46,14 @@ def get_transport():
return HttpTransport()
def get_client(wsdl, log_prefix, **kwargs):
def get_client(wsdl, log_prefix, plugins=[], **kwargs):
"""
Get a SOAP Client object for the given WSDL. Client objects are cached in :attr:`soap.clients <soap.clients>`
and keyed by the WSDL URL.
:param wsdl: String URL of a SOAP WSDL
:param log_prefix: String prefix to prepend to log lines (when logging XML traffic in DEBUG mode)
:param plugins: List of additional plugins :class:`suds.plugin.Plugin <suds.plugin.Plugin>` to pass on to the :class:`suds.client.Client <suds.client.Client>` object.
:param kwargs: Optional keyword arguments to pass on to the :class:`suds.client.Client <suds.client.Client>` object
:return: :class:`suds.client.Client <suds.client.Client>` object
:rtype: suds.client.Client
......@@ -61,7 +62,6 @@ def get_client(wsdl, log_prefix, **kwargs):
wsdl = settings.WSDL_INTERCEPTS[wsdl]
if wsdl not in clients:
plugins = []
if settings.DEBUG:
plugins.append( LogPlugin(log_prefix) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment