I am constantly getting an “invalid alarm error” with the Add method of AlarmCommandToken API when pushing an alarm to the management client using the API.
Here is my SOAP message which I am sending:
<soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:cen=“http://videoos.net/2/CentralServerAlarmCommand” xmlns:urn=“urn:milestone-systems”>
<!--Optional:-->
<cen:token>TOKEN#014b743c-5ce9-42d9-800e-e4528e554eb8#[win-79sljaanr8l.in.idemia.com//ServerConnector#</cen:token>](http://win-79sljaanr8l.in.idemia.com//ServerConnector#%3C/cen:token%3E "http://win-79sljaanr8l.in.idemia.com//ServerConnector#%3C/cen:token%3E")
<!--Optional:-->
<cen:alarm>
<urn:EventHeader>
<urn:ID>00000000-0000-0000-0000-000000000000</urn:ID>
<urn:Timestamp>2021-02-04T10:00:00.000Z</urn:Timestamp>
<!--Optional:-->
<urn:Priority>1</urn:Priority>
<!--Optional:-->
<urn:PriorityName>High</urn:PriorityName>
<!--Optional:-->
<urn:Name>External Event</urn:Name>
<!--Optional:-->
<urn:Source>
<urn:FQID>
<!--Optional:-->
<urn:ServerId>
<!--Optional:-->
<urn:Hostname>localhost</urn:Hostname>
</urn:ServerId>
<!--Optional:-->
<urn:ObjectId>52c65d53-e611-4875-ba2d-d8cd5017ea84</urn:ObjectId>
</urn:FQID>
</urn:Source>
</urn:EventHeader>
<!--Optional:-->
<urn:State>1</urn:State>
<!--Optional:-->
<urn:StateName>New</urn:StateName>
<!--Optional:-->
<urn:Category>2</urn:Category>
<!--Optional:-->
<urn:CategoryName>Critical</urn:CategoryName>
<!--Optional:-->
<urn:Count>1</urn:Count>
</cen:alarm>
</cen:Add>
</soapenv:Body>
</soapenv:Envelope>
The alarm category is already defined in management client. I have also tried various other options without succcess. Is there any documentation, on which fields are mandatory? Also, Am I doing anything wrong (like missing any important fields) ?
Here is the SOAP response I get:
<s:Envelope xmlns:s=“http://schemas.xmlsoap.org/soap/envelope/”>
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>Unhandled exception: System.ArgumentException: Invalid alarm
at VideoOS.Event.Server.Event.RuleEngine.ProcessAlarm(Alarm alarm)
at VideoOS.Event.Server.WebService.Alarm.AlarmCommandToken.Add(String token, Alarm alarm)
<detail>
<AlarmServiceFault xmlns="[http://schemas.datacontract.org/2004/07/VideoOS.Platform.Proxy.Alarm](http://schemas.datacontract.org/2004/07/VideoOS.Platform.Proxy.Alarm)" xmlns:i="[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)">
<ErrorDescription>Unhandled exception: System.ArgumentException: Invalid alarm
at VideoOS.Event.Server.Event.RuleEngine.ProcessAlarm(Alarm alarm)
at VideoOS.Event.Server.WebService.Alarm.AlarmCommandToken.Add(String token, Alarm alarm)
<ErrorReason>Unknown</ErrorReason>
</AlarmServiceFault>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>