I have the following code:
from suds.client import Client import logging logging.basicConfig(level=logging.INFO) logging.getLogger('suds.client').setLevel(logging.DEBUG) logging.getLogger('suds.transport').setLevel(logging.DEBUG) logging.getLogger('suds.xsd.schema').setLevel(logging.DEBUG) logging.getLogger('suds.wsdl').setLevel(logging.DEBUG) SB_PRIVATE_ACCESS = {"PATH":"https://thisurl.com:443/services/",} client = Client(SB_PRIVATE_ACCESS['PATH']) print client
but I am getting 500 errors. I am trying to send what XML is being generated and received through SUDs, to the wsdl developer, but I can't figure how to output it? I have been looking in the documentation of SUDs, but can't seem to find it :/ Does anyone know how to output the raw xml that is sent and received?
Install Suds Suds is a SOAP module for Python, which allows Python to consume wsdl files. Setuptools that you installed in the previous step includes an Easy Install program that you can use to install the correct version of suds. Download the suds egg from https://pypi.python.org/pypi/suds.
GitHub - suds-community/suds: Suds is a lightweight SOAP python client for consuming Web Services. A community fork of the jurko fork.
Suds is a lightweight library that uses SOAP based clients for python. SOAP is an RPC (Remote Procedure Call) that uses object-oriented protocol. Suds is actually lightweight SOAP python client that provides a service proxy for web services.
SUDS provides some convenience methods to do just that:
client.last_sent() client.last_received()
These should provide you with what you need. I use them for error logging. The API doc for Client class should have any extra info you need.
You can use the MessagePlugin to do this (this will work on the newer Jurko fork where last_sent and last_received have been removed)
from suds.plugin import MessagePlugin class LogPlugin(MessagePlugin): def sending(self, context): print(str(context.envelope)) def received(self, context): print(str(context.reply)) client = Client("http://localhost/wsdl.wsdl", plugins=[LogPlugin()])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With