0

I receive this response from a SOAP service, but I am not able to parse the response. I want to read the values for 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")

Here is how the response looks like in pydev debugger in Eclipse:

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" 

I tried to parse the response using this, but I get the error below:

xml_data = etree.parse(soapCall) 

The error:

TypeError: cannot parse from 'GetStockResponse'
Payam Mesgari
  • 953
  • 1
  • 19
  • 38

0 Answers0