I know about https://doc.developer.milestonesys.com/html/index.html?base=samples/alarmlist_sample.html&tree=tree_3.html
I’m unable to make it work:
$uri = 'http://localhost:22331/Central/AlarmService2?wsdl'
$alarms = New-WebServiceProxy -Uri $uri -UseDefaultCredential
$type = $alarms.GetType().Namespace + '.AlarmFilter'
$filter = New-object($type)
$alarms.GetAlarmLines(0, 0, 0, 0, $filter)
Exception calling "GetAlarmLines" with "5" argument(s): "The underlying connection was closed: An unexpected error occurred on a receive."
Notice that I had to use the 5 parameters overload. If I use the 3 parameters overload (like it’s supposed to be) I get this:
Cannot find an overload for "GetAlarmLines" and the argument count: "3".
Any idea?
I also tried with a token but that does not work:
$uri = 'http://localhost:80/ServerAPI/ServerCommandService.asmx?WSDL'
$server = New-WebServiceProxy -Uri $uri -UseDefaultCredential
$guid = (New-Guid).ToString()
$token = $server.Login($guid, $null)
$configuration = $server.GetConfiguration($token)
$uri = 'http://localhost:22331/Central/AlarmService2?wsdl'
$uri = 'http://localhost:22331/Central/AlarmServiceToken?wsdl'
$alarms = New-WebServiceProxy -Uri $uri -UseDefaultCredential
$type = $alarms.GetType().Namespace + '.AlarmFilter'
$filter = New-object($type)
$alarms.GetAlarmLines($token, 0, 0, 0, 0, $filter)
I get this:
Exception calling "GetAlarmLines" with "6" argument(s): "Invalid authentication"
Rik
(Rie Kiuchi (Milestone Systems))
July 1, 2020, 1:54pm
3
Can you please tell us about your server? Which version and edition of XProtect are you using?
Hello,
This happens on XProtect Corporate 2020 R1.
The ServerCommandService API works fine (in my code above $configuration is usable and works well), it’s really the Alarm API that has trouble connecting. Maybe I need to auth differently?
By the way it works fine throught the MIP SDK, it’s only through the protocol API that it fails.
Rik
(Rie Kiuchi (Milestone Systems))
July 3, 2020, 11:47am
6
You might already test unmodified Alarm list sample, but let me suggest to test it and if it works for you then please explore the sample please.
Ah, yes the Alarm list sample works.
It’s only through powershell that it doesn’t. Weird.
Rik
(Rie Kiuchi (Milestone Systems))
July 6, 2020, 2:33pm
8
Since the sample works for you, can you please explore this sample? Hopefully, you can detect whether it does different compared to the code you have made.