Im trying to get “EventTriggerWithMetadata” to work without Success.
Cant find any Sample.
Can someone help?
The last test i did:
<x:Envelope xmlns:x="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xpr="http://videoos.net/2/XProtectCSServerCommand">
<x:Header/>
<x:Body>
<xpr:EventTriggerWithMetadata>
<xpr:token>TOKEN#af7329bf-4b49-4bbc-aafb-9dd9efa79286#configcenter//ServerConnector#</xpr:token>
<xpr:eventId>fbabd862-165a-4383-bf9e-066b1fb6c864</xpr:eventId>
<xpr:metadata>
<targetDevices>
<deviceIds>
<deviceId>847AB12A-79E0-4948-A13F-FE149C0F205A</deviceId>
<deviceId>7CA28FB8-EF62-4FBC-85C9-08DB42A4A42B</deviceId>
</deviceIds>
</targetDevices>
</xpr:metadata>
</xpr:EventTriggerWithMetadata>
</x:Body></x:Envelope>
Without Success. The Command gets receyved but i cant use the deviceIds in the Rule.
Still no Success. Does anyone have a Sample how to use it?
Unfortunately there is no sample in the MIP SDK.
One thing that I am wondering, do you see anything related to this if you look into this log? -
“[C:\ProgramData\Milestone\XProtect](file:C:/ProgramData/Milestone/XProtect) Management Server\Logs\RuleSystem.log”
Yes. It shows an error that it can not Parse the Metadata.
It tryed to format everything inside
<xpr:metadata>
in different ways without success.
2017-04-13 16:02:27.552+02:00 [ 25] ERROR - CreateTargetDeviceListFromMetaData(), parsing of TargetDevices from metadata failed:
Ungültige Daten auf Stammebene. Zeile 1, Position 1.
Metadata: 847ab12a-79e0-4948-a13f-fe149c0f205a
Is there someone that can help me on this problem asap?
Someone i can call?
try to add:
referring to
Milestone ServerCommandService SOAP protocol
void ServerCommandService.EventTriggerWithMetadata
-
This command will trigger a defined event on a VMS. This command is similar to the EventTrigger, except that this command include references to device ids (usually camera guids), that are used as parameters for issueing the event.The format of the KeyValue pair is two strings, where the key contains a simple name, and the Value contains a XML definition..
Surported key-values:Key: TargetDevicesValue: XML node with two inner nodes. See sample below:
device1-GUID device2-GUID deviceGroup1-GUID deviceGroup2-GUID
-
The deviceGroupIds not being present causes the parsing of the xml to fail.
This is my interpretation of the error message, I have no experiment or testing to prove this so please let me know if it works.
Finaly found the Solution. The main problem was that i had to encode the XML to html. No need to put any deviceGroup.
Here a Sample that works perfectly:
<x:Envelope xmlns:x="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xpr="http://videoos.net/2/XProtectCSServerCommand">
<x:Header/>
<x:Body>
<xpr:EventTriggerWithMetadata>
<xpr:token>TOKEN#ad6af38a-8aef-46bf-a34c-fa0a0e1a7095#configcenter//ServerConnector#</xpr:token>
<xpr:eventId>35938a55-1621-4cf3-b215-0190179cc5cb</xpr:eventId>
<xpr:metadata>
<xpr:KeyValue>
<xpr:Key>TargetDevices</xpr:Key>
<xpr:Value><targetDevices><deviceIds><deviceId>847ab12a-79e0-4948-a13f-fe149c0f205a</deviceId><deviceId>7ca28fb8-ef62-4fbc-85c9-08db42a4a42b</deviceId></deviceIds></targetDevices></xpr:Value>
</xpr:KeyValue>
</xpr:metadata>
</xpr:EventTriggerWithMetadata>
</x:Body>
</x:Envelope>