Search code examples
pythonamazon-web-servicessoapwsdl

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.


Solution

  • The REST or "Query" APIs are definitely easier to use than SOAP, but unfortunately at least one 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.