Is this code to get a soap request correct?

import requests
import xml.etree.ElementTree as ET

# Define the SOAP request
soap_request = """<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <GetConnectRequests xmlns="https://mythologicinteractive.com/Games/SFD/">
      <port>52233</port>
      <serverApplicationInstance>830af0c3-4fa7-4efd-ac27-0a86bc69803f</serverApplicationInstance>
    </GetConnectRequests>
  </soap:Body>
</soap:Envelope>
"""

# Define the SOAP endpoint URL
soap_url = "http://mythologicinteractive.com/SFDGameServices.asmx"

def extract_data_from_response(response):
    # Define namespaces to be used for parsing
    namespaces = {
        'soap': 'http://schemas.xmlsoap.org/soap/envelope/',
        'sfd': 'https://mythologicinteractive.com/Games/SFD/',
    }

    # Removing namespaces from tags to simplify the process
    ET.register_namespace('', namespaces['sfd'])

    # Parse the XML response
    root = ET.fromstring(response.text)

    # Find all 'SFDConnectRequest' elements within the response
    sfd_connect_requests = root.findall(".//sfd:SFDConnectRequest", namespaces)

    result = []

    for connect_request in sfd_connect_requests:
        # Extract data elements from each connect request
        request_time = connect_request.find("sfd:RequestTime", namespaces).text
        client_address_ipv4 = connect_request.find("sfd:ClientAddressIPv4", namespaces).text
        client_address_ipv6 = connect_request.find("sfd:ClientAddressIPv6", namespaces).text
        client_lip = connect_request.find("sfd:ClientLIP", namespaces).text
        client_listening_port = connect_request.find("sfd:ClientListeningPort", namespaces).text
        client_application_instance = connect_request.find("sfd:ClientApplicationInstance", namespaces).text
        server_address_ipv4 = connect_request.find("sfd:ServerAddressIPv4", namespaces).text
        server_address_ipv6 = connect_request.find("sfd:ServerAddressIPv6", namespaces).text
        server_lip = connect_request.find("sfd:ServerLIP", namespaces).text
        server_host_port = connect_request.find("sfd:ServerHostPort", namespaces).text
        server_application_instance = connect_request.find("sfd:ServerApplicationInstance", namespaces).text

        # Create a dict of the fetched data
        request_info = {
            "request_time": request_time,
            "client_address_ipv4": client_address_ipv4,
            "client_address_ipv6": client_address_ipv6,
            "client_lip": client_lip,
            "client_listening_port": client_listening_port,
            "client_application_instance": client_application_instance,
            "server_address_ipv4": server_address_ipv4,
            "server_address_ipv6": server_address_ipv6,
            "server_lip": server_lip,
            "server_host_port": server_host_port,
            "server_application_instance": server_application_instance,
        }

        # Append the information to the result list
        result.append(request_info)

    return result

def fetch_connect_requests():
    # Define the headers for the SOAP request
    headers = {
        "User-Agent": "Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 4.0.30319.42000)",
        "Content-Type": "text/xml; charset=utf-8",
        "SOAPAction": 'https://mythologicinteractive.com/Games/SFD/GetConnectRequests',
        "Host": "mythologicinteractive.com",
        "Content-Length": str(len(soap_request)),
        "Expect": "100-continue",
        "Connection": "Keep-Alive",
    }

    try:
        # Send the SOAP request
        response = requests.post(soap_url, data=soap_request, headers=headers)

        # Print out the request and response for debugging
        print("Request:")
        print(response.request.body)
        print("Response:")
        print(response.text)

        # Check if the request was successful (HTTP status code 200)
        if response.status_code == 200:
            # Extract data from the XML response
            result = extract_data_from_response(response)
            print(f"Number of connect requests: {len(result)}")
            return result
        else:
            print(f"Failed to fetch data from the SOAP service. Status Code: {response.status_code}")
            return None
    except Exception as e:
        print(f"An error occurred: {str(e)}")
        return None

# Example usage:
connect_requests_data = fetch_connect_requests()
if connect_requests_data:
    for request in connect_requests_data:
        print(request)
else:
    print("Failed to fetch data from the SOAP service.")


heres the site for documentation --> https://mythologicinteractive.com/SFDGameServices.asmx?op=GetConnectRequests

Heres the documentation

GetConnectRequests
Test
The test form is only available for requests from the local machine.
SOAP 1.1
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

POST /SFDGameServices.asmx HTTP/1.1
Host: mythologicinteractive.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://mythologicinteractive.com/Games/SFD/GetConnectRequests"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetConnectRequests xmlns="https://mythologicinteractive.com/Games/SFD/">
      <port>unsignedShort</port>
      <serverApplicationInstance>guid</serverApplicationInstance>
    </GetConnectRequests>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetConnectRequestsResponse xmlns="https://mythologicinteractive.com/Games/SFD/">
      <GetConnectRequestsResult>
        <SFDConnectRequest>
          <RequestTime>dateTime</RequestTime>
          <ClientAddressIPv4>string</ClientAddressIPv4>
          <ClientAddressIPv6>string</ClientAddressIPv6>
          <ClientLIP>string</ClientLIP>
          <ClientListeningPort>unsignedShort</ClientListeningPort>
          <ClientApplicationInstance>guid</ClientApplicationInstance>
          <ServerAddressIPv4>string</ServerAddressIPv4>
          <ServerAddressIPv6>string</ServerAddressIPv6>
          <ServerLIP>string</ServerLIP>
          <ServerHostPort>unsignedShort</ServerHostPort>
          <ServerApplicationInstance>guid</ServerApplicationInstance>
        </SFDConnectRequest>
        <SFDConnectRequest>
          <RequestTime>dateTime</RequestTime>
          <ClientAddressIPv4>string</ClientAddressIPv4>
          <ClientAddressIPv6>string</ClientAddressIPv6>
          <ClientLIP>string</ClientLIP>
          <ClientListeningPort>unsignedShort</ClientListeningPort>
          <ClientApplicationInstance>guid</ClientApplicationInstance>
          <ServerAddressIPv4>string</ServerAddressIPv4>
          <ServerAddressIPv6>string</ServerAddressIPv6>
          <ServerLIP>string</ServerLIP>
          <ServerHostPort>unsignedShort</ServerHostPort>
          <ServerApplicationInstance>guid</ServerApplicationInstance>
        </SFDConnectRequest>
      </GetConnectRequestsResult>
    </GetConnectRequestsResponse>
  </soap:Body>
</soap:Envelope>