ONVIF認証に完全に行き詰まっています。私はすべて、または少なくともほとんどすべてを試したと思いますが、インターネット上で十分な情報が見つかりません。svcutil を使用してスタブ クライアントを作成しました。認証を行うためのコードは次のとおりです (多くのことを試したので、そのうちの 1 つです)。
string uri = "http://140.0.22.39/onvif/services";
EndpointAddress serviceAddressPrueba = new EndpointAddress(uri);
HttpTransportBindingElement httpBinding = new HttpTransportBindingElement();
httpBinding.AuthenticationScheme = AuthenticationSchemes.Digest;
var messegeElement = new TextMessageEncodingBindingElement();
messegeElement.MessageVersion = MessageVersion.CreateVersion(EnvelopeVersion.Soap12, AddressingVersion.None);
CustomBinding bindprueba = new CustomBinding(messegeElement, httpBinding);
DeviceClient clientprueba = new DeviceClient(bindprueba, serviceAddressPrueba);
string passwordDigestBase64;
//HERE I PUT THE CODE TO ENCRYPT THE PASSWORD.
PasswordDigestBehavior behavior1 = new PasswordDigestBehavior("root",passwordDigestBase64);
clientprueba.Endpoint.Behaviors.Add(behavior1);
string d1;
string d2;
string d3;
string d4;
clientprueba.GetDeviceInformation(out d1, out d2, out d3, out d4);
この後、次のエラーがあります。
{"The remote server returned an unexpected response: (400) Bad Request."}
これを解決するための情報を提供していただければ、非常に感謝しています。