views:

1166

answers:

4

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.

+1  A: 

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.

Keith Fitzgerald
How would you do this? And can't WSDL describe REST bindings, too?
Dave Peck
+3  A: 

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.

mithrandi
This question has been open for quite some time; I've decided that this is the most pragmatic response, though it does not address the fundamental issue. Fundamentally, python's support for SOAP is subpar; there is no truly workable solution as of today.
Dave Peck
A: 

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

Perhaps, but first see my comment about boto in the original question I asked.
Dave Peck
A: 

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

mcauth