How to access information in a python xml response

Asked

Viewed 19 times

0

Good afternoon, I’m trying to make an integration with a Soap system and I don’t know how to get the information it returns to me, only work with json so far and it’s quite different, follow the code and the answer

import xmltodict
import requests
import json
from datetime import date
import zeep
import xml.etree.ElementTree as ET
import xml.dom.minidom

url = "http://177.11.209.20/wsadmin/ws.asmx?WSDL"

payload = """
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:vsc="vscwsadmin">
   <soap:Header/>
   <soap:Body>
      <vsc:Login>
         <!--Optional:-->
         <vsc:strUserName>integrabtv</vsc:strUserName>
         <!--Optional:-->
         <vsc:strUserPassword>@twplu9hy</vsc:strUserPassword>
      </vsc:Login>
   </soap:Body>
</soap:Envelope>
"""
headers = {
  "content-type" : "application/soap+xml",
  "Accept": "application/xml"
}

response = requests.post(url, headers=headers, data=payload)
a = response.text

xmlparse = xml.dom.minidom.parseString(a)

prettyxml = xmlparse.toprettyxml()
print(prettyxml)

and the answer is as follows::

inserir a descrição da imagem aqui

How do I get the information from Message and WSVSC?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.