FalkTannhaeuser / python-onvif-zeep

ONVIF Client Implementation in Python 2+3 (using https://github.com/mvantellingen/python-zeep instead of suds as SOAP client)
MIT License
424 stars 138 forks source link

GetProfiles error, how to check if the camera is suitable for onvif? #66

Open Yangxiaojun1230 opened 4 years ago

Yangxiaojun1230 commented 4 years ago

mycam = ONVIFCamera('192.168.1.23', 80, 'service', 'Bosch!23') media = mycam.create_media_service() def zeep_pythonvalue(self, xmlvalue): return xmlvalue

zeep.xsd.simple.AnySimpleType.pythonvalue = zeep_pythonvalue ptz = mycam.create_ptz_service()

all above could run correctly, then when move to media_profile = media.GetProfiles()[0]

HTTPError Traceback (most recent call last) C:\ProgramData\Anaconda3\lib\site-packages\suds\transport\http.py in send(self, request) 77 log.debug('sending:\n%s', request) ---> 78 fp = self.u2open(u2request) 79 self.getcookies(fp, u2request)

C:\ProgramData\Anaconda3\lib\site-packages\suds\transport\http.py in u2open(self, u2request) 118 else: --> 119 return url.open(u2request, timeout=tm) 120

C:\ProgramData\Anaconda3\lib\urllib\request.py in open(self, fullurl, data, timeout) 531 meth = getattr(processor, meth_name) --> 532 response = meth(req, response) 533

C:\ProgramData\Anaconda3\lib\urllib\request.py in http_response(self, request, response) 641 response = self.parent.error( --> 642 'http', request, response, code, msg, hdrs) 643

C:\ProgramData\Anaconda3\lib\urllib\request.py in error(self, proto, args) 569 args = (dict, 'default', 'http_error_default') + orig_args --> 570 return self._call_chain(args) 571

C:\ProgramData\Anaconda3\lib\urllib\request.py in _call_chain(self, chain, kind, meth_name, args) 503 func = getattr(handler, meth_name) --> 504 result = func(args) 505 if result is not None:

C:\ProgramData\Anaconda3\lib\urllib\request.py in http_error_default(self, req, fp, code, msg, hdrs) 649 def http_error_default(self, req, fp, code, msg, hdrs): --> 650 raise HTTPError(req.full_url, code, msg, hdrs, fp) 651

HTTPError: HTTP Error 400: Bad Request