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

Question:

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.

Asked By: Dave Peck

||

Answers:

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.

Answered By: Keith Fitzgerald

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.

Answered By: mithrandi

Check out http://boto.googlecode.com. This is the best way to use AWS in Python.

Answered By: Patrick Altman

FWIW, I get this Amazon WSDL to parse with Suds 0.3.8:

url = ‘http://s3.amazonaws.com/ec2-downloads/2009-04-04.ec2.wsdl
c = Client(url)
print c

— snip —
Ports (1):
(AmazonEC2Port)
Methods (43):
— Much more removed for brevity —

-Matt

Answered By: mcauth