-
-
Notifications
You must be signed in to change notification settings - Fork 610
Description
I am testing with Zeep and an ONVIF camera, but I am unable to get the "xsd:duration" field to properly work.
I use the following WSDL:
https://github.com/FalkTannhaeuser/python-onvif-zeep/blob/zeep/wsdl/events.wsdl
My code is as follows:
e = Client('wsdl/events.wsdl', wsse=UsernameToken('admin', 'admin123', use_digest=False))
service3 = e.create_service('{http://www.onvif.org/ver10/events/wsdl}PullPointSubscriptionBinding', 'http://192.168.2.161:8000/onvif/PullSubManager?Idx=00_0')
req = service3.PullMessages(Timeout='PT10S', MessageLimit=30)
This generates almost a correct soap/xml request, except the Timeout='PT10S' (or any value) changes to "P%P", which the camera of course does not like.
The output SOAP looks like:
<?xml version='1.0' encoding='utf-8'?> <soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"><soap-env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Action>http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesRequest</wsa:Action><wsa:MessageID>urn:uuid:2889fc4a-2dae-4980-a335-60ea540e6c3a</wsa:MessageID><wsa:To>http://192.168.2.161:8000/onvif/PullSubManager?Idx=00_2</wsa:To><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:UsernameToken><wsse:Username>admin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">admin123</wsse:Password></wsse:UsernameToken></wsse:Security></soap-env:Header><soap-env:Body><ns0:PullMessages xmlns:ns0="http://www.onvif.org/ver10/events/wsdl"><ns0:Timeout>P%P</ns0:Timeout><ns0:MessageLimit>30</ns0:MessageLimit></ns0:PullMessages></soap-env:Body></soap-env:Envelope>