我从SOAP服务收到此响应,但我无法解析响应。我想阅读gtin的值。
client = zeep.Client(wsdl=wsdl)
#The soap call receives 4 arguments, the last argument is the response format
soapCall = client.service.GetStock(1,104500009,104500009,"XML")
以下是Eclipse中pydev调试器中响应的样子:
GetStockResponse: {\n 'GetStockResult': '<DRSStock>\\n <Shop Number="1">\\n <s v="104500009" vi1="13" vi2="1001" gtin="5018746023776" q="1" /> <s v="104500009" vi1="31" vi2="1001" gtin="5018746004058" q="0" /> <s v="104500009" vi1="32" vi2="1001"
我尝试使用此解析响应,但我收到以下错误:
xml_data = etree.parse(soapCall)
错误:
TypeError: cannot parse from 'GetStockResponse'