I have been working on ONVIF for a week. I want to implement all the services provided by the ONVIF. I have managed to discover ONVIF devices and get information about the devices(like device's name, profiles, Uri ). I am using Onvif(discovery, services, session, utils) and utils( async, common, diagnostic ,utils.fsharp) as a project in my code.
I have two Cameras One is ReadLeaf and other is IPNC. I am able to discover both of them successfully. And when i am trying to get information about the devices i am able to get information of the ReadLeaf camera correctly but in case of IPNC it is giving me a error:-
'System.ServiceModel.Security.MessageSecurityException' occurred in mscorlib.dll but was not handled in user code.
Additional information: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Digest realm="onvif", qop="auth,auth-int", nonce="587343b5ca703a95f874", opaque="08138641"'.
I googled this error and find that there could be two possible problems:
1) Mismatch between security settings on client and server.
2) This usually happens because the message is sending a timestamp to Web log server and the response is coming with no timestamp, try turning off the timestamp in the security.
And then i have chat with my senior who told me that there is problem in the onvif implementation on the camera side. Camera manufacturer didn't implement the onvif correctly into their camera.
Now, I am little bit confused that what is the exact problem here and what's the solution for the problem.
Camera Details:-
ReadLeaf Model - RLC-DF2011
IPNC Model - ONVIF_IPNC
Any kind of help will be highly appreciable.
Thanks.
The camera implements the optional HTTP digest authentication. When a profile S camera implements both UsernameToken and HTTP digest authentication, the latter has to be proposed to the client if no authentication is provided.
The error that you see is probably because you are invoking an ONVIF function that requires authentication without providing credentials, thus the camera returns HTTP 401.
Just repeat the call by adding the crediantials for HTTP digest authentication. And be prepared to receive a soap error instead a HTTP 401 if you'll use a camera that does not implement digest.