Есть ли способ получить тело ответа soap веб-службы в python - PullRequest
0 голосов
/ 02 мая 2020

пробовал ниже код

from zeep import Client
import requests
import os

wsdl_url = 'http://www.dneonline.com/calculator.asmx?wsdl'                                                                         
data1 = [100]                                                     
data2 = [150]                                                      

for x,y in zip(data1,data2):

        responsevalue=Client(wsdl=wsdl_url)
        responsevalue.service.Add(x,y)         

        response= requests.post(wsdl_url)
        responseoriginal = response.content
        print(responseoriginal)

но получал ниже отклик Фактический:

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">System.Web.Services.Protocols.SoapException: Server was unable to process request. ---&gt; System.Xml.XmlException: Root element is missing.

   at System.Xml.XmlTextReaderImpl.Throw(Exception e)

   at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)

   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()

Expected : to get entire soap response body <soap:Body>...</soap:Body>
...