Could you tell me why I am getting failed to fetch data from soap service?

C:\Users\Ninja\Downloads\StepsForSFDLOADER>python test2.py
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>

Response:
<?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><GetConnectRequestsResponse xmlns="https://mythologicinteractive.com/Games/SFD/"><GetConnectRequestsResult /></GetConnectRequestsResponse></soap:Body></soap:Envelope>
Failed to fetch data from the SOAP service.

Heres the code

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 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:
            # Parse the XML response
            root = ET.fromstring(response.text)

            # Extract and process the data you need from the XML response
            connect_requests = root.findall(".//{https://mythologicinteractive.com/Games/SFD/}ConnectRequest")

            result = []

            for connect_request in connect_requests:
                # Extract information about each connect request and append to the result list
                request_id = connect_request.find("{https://mythologicinteractive.com/Games/SFD/}RequestId").text
                # Add more fields if needed...

                request_info = {
                    "request_id": request_id,
                    # Add more fields if needed...
                }

                result.append(request_info)

            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 documentation

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>