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
428 stars 140 forks source link

Fix events pullpoint service and some imports that fail in python3 #17

Closed iomihai closed 6 years ago

iomihai commented 6 years ago

The PullPointSubscription address type is different with zeep than with suds. The actual address in contained in the _value_1 attribute. Also the get_definition method returns the wrong xaddr for the pullpoint service. I have added the portType parameter to get to the correct url.

These changes fix issue https://github.com/FalkTannhaeuser/python-onvif-zeep/issues/8 for me.

In client.py some imports do not work in python3

from exceptions import ONVIFError
from definition import SERVICES

This fixes the issue I added yesterday https://github.com/FalkTannhaeuser/python-onvif-zeep/issues/16

elsampsa commented 5 years ago

As of today, following the example

https://github.com/FalkTannhaeuser/python-onvif-zeep/blob/zeep/examples/events.py

At

req = pullpoint.create_type('PullMessages')

I get

LookupError: No element 'PullMessages' in namespace http://docs.oasis-open.org/wsrf/rw-2. Available elements are:  - 

Sure I can skip that type creation and do directly

pullpoint_service.PullMessages({"Timeout":"PT1S", "MessageLimit":10})

But then I get

ONVIFError: Unknown error: the parameter value is illegal

I used to be able to hack this **** in the old quantanium-onvif (based on suds), by manipulating the soap headers directly (there was something fishy there). Don't know how to do it here.