Skip to content

xsd:duration field becomes corrupted to "P%P" whatever value I put in #876

Closed

Description

@ualex73

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>

Activity

  1. ualex73 commented on Dec 2, 2018

    @ualex73
    Author

    I tried it a few times with different Python3 versions and also the official ONVF event.wsdl, and the Timeout is always corrupted in the output SOAP ... I guess this needs to be a bug in Zeep?

  2. elsampsa commented on Mar 26, 2019

    @elsampsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions