代码拉取完成,页面将自动刷新
import requests
# 定义请求的 WSDL URL
wsdl_url = "http://192.168.1.16:9999/ActiveDataService/"
# 定义 SOAPAction
soap_action = "http://tempuri.org/IActiveDataService/GetAllActiveEvents"
# 定义 XML 消息体
xml_body = '''
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
</s:Body>
</s:Envelope>
'''
try:
# 构建请求头
headers = {
"Content-Type": "text/xml; charset=utf-8",
"soapaction": soap_action,
'accept-encoding': 'gzip, deflate',
'connection': 'Keep-Alive',
'expect': '100-continue'
}
# 发送 POST 请求
response = requests.post(wsdl_url, data=xml_body, headers=headers)
# 检查响应状态码
if response.status_code == 200:
# 打印响应内容
print(response.text)
else:
print("Failed to retrieve WSDL file. Status code:", response.status_code)
except Exception as e:
print("An error occurred:", e)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。