ONVIF and PTZ Access to IP Cameras

user704419 picture user704419 · Aug 11, 2011 · Viewed 9.7k times · Source

I'm in trouble here about the ONVIF IP Camera specification. I've built a program that is able to use the standard to contact cameras and send them standard media/device requests.

The problem is that I'm now trying to access their PTZ capacities through the ONVIF and that for both of my cameras, I only get this following error :

HTTP/1.1 400 Bad Request
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 741
Connection: keep-alive

<?xml version="1.0" encoding="UTF-8"?>
<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:ter="http://www.onvif.org/ver10/error">

<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<SOAP-ENV:Code>
<SOAP-ENV:Value>SOAP-ENV:Sender</SOAP-ENV:Value>
<SOAP-ENV:Subcode>
<SOAP-ENV:Value>ter:Namespace</SOAP-ENV:Value>
</SOAP-ENV:Subcode>
</SOAP-ENV:Code>
<SOAP-ENV:Reason>
<SOAP-ENV:Text xml:lang="en">Namespace Error</SOAP-ENV:Text></SOAP-ENV:Reason>
<SOAP-ENV:Node>http://www.w3.org/2003/05/soap-envelope/node/ultimateReceiver</SOAP-ENV:Node>
<SOAP-ENV:Role>http://www.w3.org/2003/05/soap-envelope/node/ultimateReceiver</SOAP-ENV:Role>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

So, namespace error.

The problem is that I got the onvif PTZ namespace of the camera (/onvif/ptz_service) through a GetCapabilities() ONVIF request.

The problem is same for any PTZ onvif request that I send to any of both of my two ONVIF cameras.

I already tried to find softwares using the ONVIF to have them send PTZ request and see if they works, but I didn't find one (There's an ONVIF Device Manager here : http://sourceforge.net/projects/onvifdm/ but there's no actual PTZ handling, unless the problem come from my cameras).

Answer

user704419 picture user704419 · Aug 16, 2011

I found the problem, which is frankly disappointing :

I was using the 2nd version (ver20) of the ONVIF PTZ WSDL file, because the 1st one (ver10) is considered as deprecated.

Turns out even the recent ONVIF camera I just bought some days ago, with an up-to-date firmware, is still using ver10.

Since I can't use SvcUtil to generate my proxy class using the ver10 wsdl, I tried switching all the "http://www.onvif.org/ver20/ptz/wsdl" namespaces with ver10 instead of ver20, and it works. For now. I hope it'll keep working with other cameras ...