AvconWebService.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. from requests import Session
  2. from requests.auth import HTTPBasicAuth
  3. from zeep import Client
  4. from zeep.transports import Transport
  5. from xmltodict3 import XmlTextToDict
  6. from pprint import pprint
  7. '''
  8. 融合通信WEB服务对接
  9. 废弃 2024-12-10**************
  10. '''
  11. def get_aws_service():
  12. session = Session()
  13. session.auth = HTTPBasicAuth("orgadmin", "admin")
  14. client = Client('http://19.152.196.106:12030/AvconWebService/services/StandarMonitorService?wsdl', transport=Transport(session=session))
  15. return client.service
  16. if __name__ == '__main__':
  17. srv = get_aws_service()
  18. response = srv.getMonitorGroup("0")
  19. print(response)
  20. res = XmlTextToDict(response, ignore_namespace=True).get_dict()
  21. print(res)
  22. groups = []
  23. retcode = res['message']['retcode']
  24. if retcode == '200':
  25. count = res['message']['count']
  26. data = res['message']['data']
  27. if int(count) == 1:
  28. group = data['group']
  29. groups = ([group])
  30. else:
  31. for n in data:
  32. groups.append(n)
  33. for group in groups:
  34. print('groupId:', group['groupId'])
  35. print('getMonitorDev:', group['groupId'], "")
  36. response = srv.getMonitorDev(group['groupId'], "", 0, 100)
  37. print(response)
  38. # response = srv.getMonitorChannel(String devId)