Using this code to connect to OnVif service on my IP Camera in C# .Net 4.5.
Very next to that code, I am trying to get Device information as follows:
string str = client.GetDeviceInformation(out model, out firmware, out serial, out hardwareId);
And encouters this error:
An exception of type '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 'Digest'. The authentication header received from the server was 'Basic realm="CBBA"'.
I tried this information about Basic realm. By adding an Http header WWW-Authenticate
to the request with value Basic realm="Our Site"
. But no luck.
What the heck is that? How to fix it?