Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the best python soap stack for consuming Amazon Web Services WSDL?

Python has a number of soap stacks; as near as I can tell, all have substantial defects.

Has anyone had luck consuming and using WSDL for S3, EC2, and SQS in python?

My experience is that suds fails when constructing a Client object; after some wrangling, ZSI generates client code that doesn't work; etc.

Finally, I'm aware of boto but as it is a hand-rolled wrapper around AWS, it is (1) incomplete and (2) never up-to-date with the latest AWS WSDL.

like image 688
Dave Peck Avatar asked Oct 23 '08 23:10

Dave Peck


People also ask

Does Python support SOAP?

suds (on PyPi) - Suds is a lightweight SOAP python client that provides a service proxy for Web Services. This is the best maintained fork of the original Suds project by Jeff Ortel, and it's compatible with Python 2 and 3.


2 Answers

The REST or "Query" APIs are definitely easier to use than SOAP, but unfortunately at least once service (EC2) doesn't provide any alternatives to SOAP. As you've already discovered, Python's existing SOAP implementations are woefully inadequate for most purposes; one workaround approach is to just generate the XML for the SOAP envelope/body directly, instead of going through an intermediate SOAP layer. If you're somewhat familiar with XML / SOAP, this isn't too hard to do in most cases, and allows you to work around any particular idiosyncrasies with the SOAP implementation on the other end; this can be quite important, as just about every SOAP stack out there has its own flavour of bugginess / weirdness to contend with.

like image 119
mithrandi Avatar answered Oct 16 '22 10:10

mithrandi


if i'm not mistaken, you can consume Amazon Web Services via REST as well as SOAP. using REST with python would be much easier.

like image 1
Keith Fitzgerald Avatar answered Oct 16 '22 08:10

Keith Fitzgerald