0

Is there a way to parse a SOAP Response (similar to XML) in Python? I have browsed through most of Stackoverflow solutions and they usually use minidom or ET functions parse() or parseString()parse() takes a filename as input, while parseString() takes a string as input. However SOAP response type is HTTPResponse and hence I am always getting type mismatch error while using parse() or parseString(), so not sure how to parse the SOAP response in Python. I have also tried converting the HTTPResponse to string (failed), or using XML function (failed), or using response.read() function (failed).

I have checked that the SOAP response is correct with valid XML. I am using SUDS to call the SOAP service.

mio
  • 159
  • 1
  • 1
  • 12
  • 2
    How about using a [SOAP library](http://stackoverflow.com/questions/206154/whats-the-best-soap-client-library-for-python-and-where-is-the-documentation-f)? – kirelagin May 30 '13 at 14:00
  • I have used https://fedorahosted.org/suds/ – oleg May 30 '13 at 14:02
  • I am actually using `SUDS` to call the SOAP service. But the question is about parsing the response received. – mio May 30 '13 at 17:34

1 Answers1

0

Ok the solution was just to cast it to a string using

str(response)

mio
  • 159
  • 1
  • 1
  • 12