I am trying to change password for honeywell camera using the follwing code
ConfigurationItem result =configApiClient.InvokeMethod(pwdConfigurationItems, "ChangePasswordHardware");
Its changing password in management client only Not updating new password in device.
If I change in management client it works and changes in device but not using configApiClient code.
Any solution?
For me the Config API Client works fine. I believe you will find that your snippet of code is not what the sample does.
I recommend to read “Method and Invoke handling” here - https://doc.developer.milestonesys.com/html/index.html?base=gettingstarted/intro_configurationapi.html&tree=tree_4.html
For a faster route to an solution for you. This is a very minimal snippet of code that uses the strongly typed classes (VideoOS.Platform.ConfigurationItems classes) this snippet works in a test project of mine.
ServerTask servertask = hardware.ChangePasswordHardware();
if (servertask.ItemType == "InvokeInfo")
{
ICollection<string> keys = servertask.GetPropertyKeys();
foreach (var key in keys)
{
string property = servertask.GetProperty(key);
label1.Text += key + " " + property + Environment.NewLine;
if (key == "Password")
{
servertask.SetProperty(key, newPassword);
label1.Text += key + " " + newPassword + Environment.NewLine;
}
}
ServerTask serverTask2 = servertask.ExecuteDefault();
if (serverTask2.ItemType == "InvokeResult" && serverTask2.State == StateEnum.Success)
{
label1.Text += "Rename complete (" + hardware.Name + ")" + Environment.NewLine;
}
}
Actual minimum
ServerTask servertask = hardware.ChangePasswordHardware();
servertask.SetProperty("Password", newPassword);
servertask.ExecuteDefault();