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
420 stars 137 forks source link

ONVIFError: Unknown error: Missing element ForcePersistence #25

Open dcyrils opened 5 years ago

dcyrils commented 5 years ago

Hi ) This is code: forcePersistence = False ptz_service.SetConfiguration(ptzConfiguration, forcePersistence)

...and I get the mistake in header (((

PS. Debug printing - Ouuups: err = Missing element ForcePersistence (SetConfiguration.ForcePersistence) , func = <function ONVIFService.service_wrapper..wrapped at 0x7fa09265f0d0> , args = ({ ....MyConfiguration... }, False) , kwargs = {} Both elements (Conf+ForcePersistence) ARE in function input... Why MISSING????

ktrufant commented 4 years ago

Trying to do this as well...

I've tried 3 methods all of which don't work.

  1. Using the create_type
    set_config_req = cam.ptz.create_type('SetConfiguration')
    set_config_req.PTZConfiguration = config
    set_config_req.ForcePersistence = False
    cam.ptz.SetConfiguration(set_config_req)
  1. Using my own dict() to represent the input (some inputs are missing here, just an example)
    new_config = {
        'token': cam.media_profile.token,
        'DefaultAbsolutePanTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/SphericalPositionSpaceDegrees',
        'Name': 'PTZConfig_1'
    }

 cam.ptz.SetConfiguration({'PTZConfiguration': new_config, 'ForcePersistence': False})
  1. The easiest method, as @dcyrils used above, cam.ptz.SetConfiguration(config, False)

All of which produce errors. Methods (1 & 2) produce the following error- Missing element Name (SetConfiguration.PTZConfiguration) Method 3 produces the same error from the previous comment- Missing element ForcePersistence (SetConfiguration.ForcePersistence) Any suggestions @FalkTannhaeuser ?