简体   繁体   中英

Parse SOAP Response in Python

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.

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

str(response)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM