Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ualex73 opened this issue Dec 1, 2018 · 2 comments
Closed

Comments

@ualex73
Copy link

ualex73 commented Dec 1, 2018

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>

@ualex73
Copy link
Author

ualex73 commented Dec 2, 2018

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?

@ualex73 ualex73 closed this as completed Dec 3, 2018
@elsampsa
Copy link

#894

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants