1

I've been trying to use suds for Python to call a SOAP WSDL. I just need to call the service programmatically and write the output XML document. However suds automatically parses this data into it's own pythonic data format. I've been looking through the examples and the documentation, but I can't seem to find a way to return the XML document that the SOAP service gives me.

Is there an easy way to do this I'm overlooking? Is there an easier way to do this in Python than suds?

2 Answers 2

3

At this early stage in suds development, the easiest way to get to the raw XML content is not what one would expect.

The examples on the site show us with something like this:

client = Client(url)
result = client.service.Invoke(subm)

however, the result is a pre-parsed object that is great for access by Python, but not for XML document access. Fortunately the Client object still has the original SOAP message received stored.

result = client.last_received()
print result

Will give you the actual SOAP message received back.

Sign up to request clarification or add additional context in comments.

Comments

0

You could take a look at a library such as soaplib: its a really nice way to consume (and serve) SOAP webservices in Python. The latest version has some code to dynamically generate Python bindings either dynamically (at runtime) or statically (run a script against some WSDL).

[disclaimer: I'm the maintainer of the project! - I didn't write the bulk of it though]

1 Comment

404 on link. Where did it move to?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.