Gather alarm with a custom alarm filter parameter

Hello, I’m using SOAP interface to develop our software integration to Milestone XProtect Corporate 2014 (the version I had).

From now on, I successfully gather XProtect Server Information/Camera and retrieve a authentication token.

I manage to add an alarm using the SOAP service ‘Add(token, alarm)’ available from http://localhost:port/Central/AlarmServiceToken?wsdl and see it in the XProtect Smart Client.

I want to call the service ‘GetAlarmLines(token, min, max, alarm_filter)’ to gather an alarm using a specific filter but the server returns me an internal error while parsing the alarm_filter object I sent to it. More specifically the server is not able to deserialize the attribute ‘Value’ passed in the ‘Condition’ attribute of the ‘AlarmFilter’.

I try to change the parameter of my filter without success (either ‘State’, StateName’)

FYI, when the ‘Conditions’ attribute of ‘AlarmFilter’ is empty, I do have a correct response from the server.

I use python to build SOAP request but the same issue arose when using another client (SOAP_UI in that case).

Is my SOAP request bad formatted somehow ? I join a sample of what I generate

Thank you for your help

Use Type.

If you look at the AlarmEventViewer sample it gathers LPR events by using -

Conditions = new Condition[] { new Condition() { Operator = Operator.Equals, Target = Target.Type, Value = “LPR Event” } }

You will have to set the Type when you submit the alarms, then you can use it to filter.

I am a bit confused : there is no Type attribute for the VideoOS.Platform.Data.Alarm object neither in the SKD 2017 documentation nor the WSDL. These are the attributes I have from the WSDL :

ns2:Alarm(

EventHeader: ns2:EventHeader,

Description: xsd:string,

StartTime: xsd:dateTime,

EndTime: xsd:dateTime,

Location: xsd:string,

State: xsd:unsignedShort,

StateName: xsd:string,

Category: xsd:unsignedShort,

CategoryName: xsd:string,

AssignedTo: xsd:string,

Count: xsd:unsignedInt,

RuleList: ns2:RuleList,

ObjectList: ns2:AnalyticsObjectList,

ReferenceList: ns2:ReferenceList,

SnapshotList: ns2:SnapshotList,

Vendor: ns2:Vendor)

But the returns type of GetAlarmLines seems to have it (and it’s a value from the enum Target in the documention)

ns6:AlarmLine(

AssignedTo: xsd:string,

CameraId: ns3:guid,

Category: xsd:unsignedShort,

CategoryName: xsd:string,

CustomTag: xsd:string,

Description: xsd:string,

FilterMatch: xsd:boolean,

Id: ns3:guid,

LocalId: xsd:int,

Location: xsd:string,

Message: xsd:string,

Modified: xsd:dateTime,

Name: xsd:string,

ObjectValue: xsd:string,

Priority: xsd:unsignedShort,

PriorityName: xsd:string,

RuleType: xsd:string,

SourceId: ns3:guid,

SourceName: xsd:string,

State: xsd:unsignedShort,

StateName: xsd:string,

Timestamp: xsd:dateTime,

Type: xsd:string,

VendorName: xsd:string)

This issue is not about which Enumeration value for Target I can use to accomplish what I want, but on the deserialization of the object VideoOS.Platform.Proxy.Alarm.AlarmFilter on the server side, in particular the type of VideoOS.Platform.Proxy.Condition.Value is somewhat bad formatted and not recognized by the Event server when I send my SOAP request.

I tried an other service ‘StartAlarmLineSession’ that used an AlarmFilter with the same error.

I also have the same type of errors using ‘StartEventLineSession’ with an EventFilter object.

Is it a server error (with a bad WSDL description ?) or a mistake on my side when making the SOAP request ?

Thank you for the help you can provide.

If you run the Alarm and Event Viewer sample, add the condition I mentioned above to the GetAlarmLines call and trace the communication you see:

<s:Envelope xmlns:s=“http://schemas.xmlsoap.org/soap/envelope/”><s:Body>010<a:Conditions><a:Condition><a:Operator>Equals</a:Operator><a:Target>Type</a:Target><a:Value i:type=“b:string” xmlns:b=“http://www.w3.org/2001/XMLSchema”>LPR Event</a:Value></a:Condition></a:Conditions><a:Orders><a:OrderBy><a:Order>Descending</a:Order><a:Target>Timestamp</a:Target></a:OrderBy></a:Orders></s:Body></s:Envelope>POST /Central/AlarmService HTTP/1.1

For further troubleshooting I would like to recommend that you use Wireshark or similar and compare what you do on the protocol with what the sample does.

Thank you, I managed to set the ‘Value’ type the server is expected with the sample you provided (I also used Wireshark to confirm what you wrote above).