我完全卡在ONVIF驗證。我想我已經嘗試過所有的東西,或者至少幾乎所有東西,而且我在互聯網上找不到足夠的信息。我已創建使用SvcUtil工具,我的代碼做認證存根客戶(他們中的一個,因爲我已經嘗試了很多東西):使用軸卡馬拉P1344的Onvif驗證c#
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."}
如果你能幫我解決這個問題,我將非常非常感激。
請檢查http://stackoverflow.com/questions/18149866/unable-to-connect-to-onvif-enabled-camera-using-c-sharp/18623888#18623888 – mhcuervo