Question

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.

Was it helpful?

Solution

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

str(response)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top