Create python soap server based on wsdl Create python soap server based on wsdl python python

Create python soap server based on wsdl


This question has not received enough attention.

The currently accepted answer is good, but its answer is 'no'. Is there really no reasonably maintained and general solution?

Unfortunately, I don't think the negative answer is due to lack of attention to the question. There really is no support for WSDL in python. If you want to avoid the complexities of building your own soap envelope from scratch the only thing I can recommend you is building a sample envelope using any of the many soap webservices tools (soapui for instance) and then use it as a template string (I know, horrible) in your python code

UPDATE you could use spyne. It's a python RPC toolkit that among other protocols supports SOAP. It will create the WSDL for you, but if your objective is implementing the service described by the WSDL you already have then you'll have to fine tune your spyne service (written in python) until the generated WSDL matches the original


When it comes to SOAP support, Python unfortunately no longer is with "batteries included". The support on client side is acceptable but on server side you are basically on your own.

You might want to look at the following for starters:

http://wiki.python.org/moin/WebServices

http://pywebsvcs.sourceforge.net/

http://doughellmann.com/2009/09/01/evaluating-tools-for-developing-with-soap-in-python.html

If you really want to go on this route, it seems that ZSI is the tool to use, although I have my doubts that it will work with the latest 2.x Python distribution.

Using Python 2.6.6, I tried to use ZSI 2.0 to build a web service starting from the WSDL. Got some "module has been deprecated" warnings when generating the code with wsdl2py and wsdl2dispatch, had to separately install PyXML and hack my sys.path just to make it resolve first or else I got "module ext.reader does not exist" then only to end up with a disappointing "ZSI:EvaluateException Got None for nillable(False), minOccurs(1) element" error on a basic "Hello world!" WS with a required element.

Switched to ZSI 2.1_a1 which no longer needs PyXML and wsdl2py does it all (what wsdl2dispatch did for 2.0) but still ended up in a dead end with "ZSI:EvaluateException Got None for nillable(False), minOccurs(1) element" errors.

The experience wasn't very fun but it was enough for me to form an opinion about what Python has to offer for SOAP web services... which ain't much (and that was just for basic web services nothing fancy like WS-* specs). YMMV!

EDIT : I recently bumped into this SO question, and although oriented versus a client solution, it does also mention a few libraries for building SOAP services.