12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- from requests import Session
- from requests.auth import HTTPBasicAuth
- from zeep import Client
- from zeep.transports import Transport
- from xmltodict3 import XmlTextToDict
- from pprint import pprint
- '''
- 融合通信WEB服务对接
- 废弃 2024-12-10**************
- '''
- def get_aws_service():
- session = Session()
- session.auth = HTTPBasicAuth("orgadmin", "admin")
- client = Client('http://19.152.196.106:12030/AvconWebService/services/StandarMonitorService?wsdl', transport=Transport(session=session))
- return client.service
- if __name__ == '__main__':
- srv = get_aws_service()
- response = srv.getMonitorGroup("0")
- print(response)
- res = XmlTextToDict(response, ignore_namespace=True).get_dict()
- print(res)
- groups = []
- retcode = res['message']['retcode']
- if retcode == '200':
- count = res['message']['count']
- data = res['message']['data']
- if int(count) == 1:
- group = data['group']
- groups = ([group])
- else:
- for n in data:
- groups.append(n)
- for group in groups:
- print('groupId:', group['groupId'])
- print('getMonitorDev:', group['groupId'], "")
- response = srv.getMonitorDev(group['groupId'], "", 0, 100)
- print(response)
-
- # response = srv.getMonitorChannel(String devId)
|