Hi,
I’m trying to get live alarms using:
- IAlarmClient.StartAlarmLineSession
- IAlarmClient.GetSessionAlarmLines
- IAlarmClient.StopAlarmLineSession
I get this error:
Data provider 'Alarms' failed to fetch data. No signature message parts were specified for messages with the 'http://videoos.net/2/CentralServerAlarmCommand/IAlarmCommand/GetSessionAlarmLinesResponse' action.
The corresponding code for events works fine.
I have reproduced on two different systems (2023 R2 and 2024 R1).
Guid liveSession = alarmClient.StartAlarmLineSession(CreateFilter());
var alarmUpdateData = alarmClient.GetSessionAlarmLines(MaxLinesLive, liveSession);
Any ideas?
I think my best course of action will be to try to reproduce your observation.
Can you please give me more of the code that I can try to reproduce the same way you use it?
Thanks! See code example below.
It is very easy. In a Smart Client plugin try this code:
try
{
int maxLinesLive = 10000;
IAlarmClient alarmClient = new AlarmClientManager().GetAlarmClient(
EnvironmentManager.Instance.MasterSite.ServerId);
Guid liveSession = alarmClient.StartAlarmLineSession(CreateAlarmFilter());
var alarmUpdateData = alarmClient.GetSessionAlarmLines(maxLinesLive, liveSession);
}
catch (System.ServiceModel.Security.MessageSecurityException)
{
// problem
}
private AlarmFilter CreateAlarmFilter()
{
return new AlarmFilter()
{
Conditions = new Condition[]
{
new Condition()
{
Operator = Operator.GreaterThan,
Target = Target.Timestamp,
Value = DateTime.UtcNow,
},
new Condition()
{
Operator = Operator.LessThan,
Target = Target.Timestamp,
Value = DateTime.UtcNow.AddDays(1)
}
},
Orders = new OrderBy[]
{
new OrderBy()
{
Target = Target.Timestamp,
Order = Order.Descending
}
}
};
}
I am unable to reproduce because I run into something different..
Exception thrown: ‘System.ServiceModel.ProtocolException’ in VideoOS.Platform.dll
An exception of type ‘System.ServiceModel.ProtocolException’ occurred in VideoOS.Platform.dll but was not handled in user code
A reply message was received for operation ‘GetSessionAlarmLines’ with action ‘http://videoos.net/2/CentralServerAlarmCommand/IAlarmCommand/GetSessionAlarmLinesResponse’. However, your client code requires action ‘http://videoos.net/2/CentralServerAlarmCommand/IAlarmCommand/GetAlarmLinesResponse’.
I will try to ask developers here at Milestone what that is. If you know what I might be doing wrong, please update me.
I think the difference came down to whether you use encrypted communication (HTTPS) or not.
Milestone Development are working on a fix.
Ok, thanks! Great to hear a fix is coming.
Following up on this, the fix is implemented in 2024R2 soon to be released.
Thanks, Bo, for the follow-up. I now tested and it works perfect with 2024 R2 BETA Smart Client.