I started using suds for soap clients and will never touch ZSI again.
I know suds is meant for the client side, but I would love to use it to make also the server site, in order to get rid of ZSI.
How could I use suds to parse soap requests instead of responses?
[updates]
SOAP stands for Simple Object Access Protocol, as the name suggests nothing but a protocol for exchanging structured data between nodes. It uses XML instead of JSON.
Python Web Services and Zolera Soap Infrastructure ((ZSI on PyPi) provides both client and server SOAP libraries.
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.
To make SOAP requests to the SOAP API endpoint, use the "Content-Type: application/soap+xml" request header, which tells the server that the request body contains a SOAP envelope. The server informs the client that it has returned a SOAP envelope with a "Content-Type: application/soap+xml" response header.
To write a SOAP server in Python, you can use the micro web framework - Flask, with it's plugin - Flask-enterprise
http://massive.immersedcode.org/2011/staging/projects/default/python/flask-enterprise/
There is also a similar question here in stackoverflow:
Python soap using soaplib (server) and suds (client)
They use soaplib for providing SOAP service, as you can find the document here http://soaplib.github.com/soaplib/2_0/pages/helloworld.html
If you decided to use Flask - try new flask-spyne extension.
flask-enterprise mentioned above is a wrapper on top of discontinued soaplib, while flask-spyne is a wrapper on top of spyne - successor of soaplib.
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