我完全卡在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