"Invalid Alarm error"- when using the Add method in AlarmCommandToken Interface

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”>

soapenv:Header/

soapenv:Body

cen:Add

 <!--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>

Can you please check if there are errors or information in Event server logs?

Event server log is “[C:\ProgramData\Milestone\XProtect](file:C:/ProgramData/Milestone/XProtect) Event Server\logs”.

@Rie Kiuchi (Milestone Systems)​ Event server doesn’t give any more details either. It says:

2021-02-11 9:06:53 PM UTC+05:30 Error AlarmCommandToken Unhandled exception in web service with message: Invalid alarm

Exception details:

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)

Unfortunately there is no protocol sample but can you please try to test this sample and see if it works for you?

https://doc.developer.milestonesys.com/html/index.html?base=samples/libraryeventgenerator_sample.html&tree=tree_2.html

If this sample does not work unmodified, we must suspect there is a general error to the XProtect VMS and your code might be correct.