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

Fix: Incorrect Onvif namespace prefix #46

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

hongquan
Copy link

@hongquan hongquan commented May 10, 2019

The bug is from Zeep: mvantellingen/python-zeep#870

This fix helps python-onvif-zeep work with some China cameras, which require the SOAP Envelop to be like this:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:wsc="http://schemas.xmlsoap.org/ws/2005/02/sc" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:dom0="http://www.axis.com/2009/event" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:ter="http://www.onvif.org/ver10/error">

<SOAP-ENV:Body>
	<tds:GetServices>
		<tds:IncludeCapability>false</tds:IncludeCapability>
	</tds:GetServices>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

and rejects:

<soap-env:Body>
	<ns0:GetServices xmlns:ns0="http://www.onvif.org/ver10/device/wsdl">
		<ns0:IncludeCapability>false</ns0:IncludeCapability>
	</ns0:GetServices>
</soap-env:Body>

as produced by current Zeep.

@hongquan
Copy link
Author

@FalkTannhaeuser What need to be done to let this PR merged?

@FalkTannhaeuser FalkTannhaeuser merged commit ef27776 into FalkTannhaeuser:zeep Aug 8, 2024
jterrace added a commit to jterrace/python-onvif-zeep-async that referenced this pull request Nov 21, 2024
This fixes some Tapo cameras that respond with a 500 error when
receiving the ns0/ns1 namespace prefix with embedded xmlns definitions
inside each element.

A similar change was done upstream here:
FalkTannhaeuser/python-onvif-zeep#46

for mvantellingen/python-zeep#870.

I also updated the events example that was broken.
bdraco added a commit to openvideolibs/python-onvif-zeep-async that referenced this pull request Dec 3, 2024
* Add shortened common onvif namespace prefixes.

This fixes some Tapo cameras that respond with a 500 error when
receiving the ns0/ns1 namespace prefix with embedded xmlns definitions
inside each element.

A similar change was done upstream here:
FalkTannhaeuser/python-onvif-zeep#46

for mvantellingen/python-zeep#870.

I also updated the events example that was broken.

* chore(pre-commit.ci): auto fixes

* Update requirements.txt

* fix examples

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

2 participants