Add ability to get a client with a defined list of plugins
Problem
I want to be able to use other plugins other than LogPlugin
on a suds Client.
Solution
Introduced the plugins
parameter on soap.get_client
. It should take a list of suds.plugin.Plugin
objects.
NOTE: LogPlugin
will still be used if settings.DEBUG
is true.
Intended use
from suds.plugin import MessagePlugin
import soap
class CustomPlugin(MessagePlugin):
def received(self, context):
print("I have received something")
# ....
client = soap.get_client(
'https://www.fake.wsdl',
'this is a log prefix',
plugins=[ CustomPlugin() ]
)
# ....