get status of a device

The goal is get the status of a device. I understood that the correct sequence in the case of basic Authenticarion and SSL is the following but not Work

This is the sequence:

  1. I create my Guid for InsstanceID for example:

97088254-afd7-4014-849e-4aadd5f91874

  1. I get the Token through the login method of the end point https: // /ManagementServer/ServerCommandService.svc

QUESTION:

<soapenv: Envelope xmlns: soapenv = “http://schemas.xmlsoap.org/soap/envelope/” xmlns: xpr = “http://videoos.net/2/XProtectCSServerCommand”>

<soapenv: Header />

<soapenv: Body>

<xpr: Login>

 <! - Optional: ->

 <xpr: instanceId> 97088254-afd7-4014-849e-4aadd5f91874 </ xpr: instanceId>

 <! - Optional: ->

 <xpr: currentToken> </ xpr: currentToken>

</ xpr: Login>

</ soapenv: Body>

</ soapenv: Envelope>

REPLY:

The answer is this:

<s: Envelope xmlns: s = “http://schemas.xmlsoap.org/soap/envelope/”>

<s: Body>

<LoginResponse xmlns = “http://videoos.net/2/XProtectCSServerCommand”>

 <LoginResult xmlns: i = "[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance "http://www.w3.org/2001/XMLSchema-instance")">

  <RegistrationTime> 2020-11-23T12: 57: 07.213Z </RegistrationTime>

  <TimeToLive>

    <MicroSeconds> 14400000000 </MicroSeconds>

  </TimeToLive>

  <TimeToLiveLimited> false </TimeToLiveLimited>

  <Token>TOKEN # aae540bf-0bc3-4deb-9d02-354c13c64d52 # 4msvms // ServerConnector #</Token>

 </LoginResult>

</ s: Body>

</ s: Envelope>

  1. I get a deviceID via GetConfiguration of the end point https: // /ManagementServer/ServerCommandService.svc

QUESTION

<soapenv: Envelope xmlns: soapenv = “http://schemas.xmlsoap.org/soap/envelope/” xmlns: xpr = “http://videoos.net/2/XProtectCSServerCommand”>

<soapenv: Header />

<soapenv: Body>

<xpr: GetConfiguration>

 <! - Optional: ->

 <xpr: token>TOKEN # aae540bf-0bc3-4deb-9d02-354c13c64d52 # 4msvms // ServerConnector #</ xpr: token>

</ xpr: GetConfiguration>

</ soapenv: Body>

</ soapenv: Envelope>

and from the content (only a part) of the answer I take a deviceid of a camera

<Recorders>

    <RecorderInfo>

     <Cameras>

       <CameraInfo>

        <CoverageDepth> 0 </CoverageDepth>

        <CoverageDirection> 0 </CoverageDirection>

        <CoverageFieldOfView> 0 </CoverageFieldOfView>

        <Description />

        <DeviceId>62f57c0d-44fc-4825-a285-89223a041729</DeviceId>

        <DeviceIndex> 0 </DeviceIndex>

        <GisPoint> POINT EMPTY </GisPoint>

        <HardwareId> 947df69a-96b0-4d8f-963e-02f116baf0f1 </HardwareId>

        <Icon> 0 </Icon>

        <Name> HikVisionGeneric (10.0.5.12) - Room 1 </Name>

        <RecorderId> 7e5750b6-3be2-4740-9247-f310a0f8f94c </RecorderId>

Now that I have the Token and the device ID I can use the GetCurrentDeviceStatus method from the End Point http:///recorderstatusservice/recorderstatusservice2.asmx

I ask the question:

<soapenv: Envelope xmlns: soapenv = “http://schemas.xmlsoap.org/soap/envelope/” xmlns: xpr = “http://videoos.net/2/XProtectCSRecorderStatus2”>

<soapenv: Header />

<soapenv: Body>

<xpr: GetCurrentDeviceStatus>

 <! - Optional: ->

 <xpr: token>TOKEN # aae540bf-0bc3-4deb-9d02-354c13c64d52 # 4msvms // ServerConnector #</ xpr: token>

 <! - Optional: ->

 <xpr: deviceIds>

  <! - Zero or more repetitions: ->

  <xpr: guid>62f57c0d-44fc-4825-a285-89223a041729</ xpr: guid>

 </ xpr: deviceIds>

</ xpr: GetCurrentDeviceStatus>

</ soapenv: Body>

</ soapenv: Envelope>

But in response I get this error which I don’t understand what it means

<soap: Envelope xmlns: xsi = “http://www.w3.org/2001/XMLSchema-instance” xmlns: xsd = “http://www.w3.org/2001/XMLSchema” xmlns: soap = "http : //schemas.xmlsoap.org/soap/envelope/ ">

<soap: Body>

<soap: Fault>

 <faultcode> soap: Server </faultcode>

 <faultstring> Error processing message </faultstring>

 <detail>

  <ErrorNumber> 10000 </ErrorNumber>

 </detail>

</ soap: Fault>

</ soap: Body>

</ soap: Envelope>

Where did I go wrong

You will need to check the WebServer.log on the recorder for the specific error:

WebServer.Logger.LogError(“SOAPRequesthandlerBase.HandleRequest: Exception: {0}”, ex);”

Excuse me but what you are telling me is in the log file and where it is. Thank you

Milestone logs are here – [C:\ProgramData\Milestone\(service](file:C:/ProgramData/Milestone/(service) name) \Log.

Please note that ProgramData is a hidden folder.

I’m running into the same issue:

Here’s what the web server log shows when I try to make the GetCurrentDeviceStatus request, and yes my guid follows the format:

2021-04-11 20:40:01.559-05:00 [ 92] ERROR - SOAPRequesthandlerBase.HandleRequest: Exception: System.FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

at System.Guid.GuidResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument, String failureArgumentName, Exception innerException)

at System.Guid.TryParseGuidWithNoStyle(String guidString, GuidResult& result)

at System.Guid.TryParseGuid(String g, GuidStyles flags, GuidResult& result)

at System.Guid..ctor(String g)

at VideoOS.Recorder.WebServer.SOAPStatus2RequestHandler.<>c.b__21_0(XmlNode n)

at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()

at System.Linq.Buffer`1..ctor(IEnumerable`1 source)

at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)

at VideoOS.Recorder.WebServer.SOAPStatus2RequestHandler.HandleGetCurrentDeviceStatus(XmlNode node, String requestNS, XmlWriter responseWriter)

at VideoOS.Recorder.WebServer.SOAPStatus2RequestHandler.ExecuteFunction(XmlNode node, String requestNS, XmlWriter responseWriter)

at VideoOS.Recorder.WebServer.SOAPRequestHandlerBase.HandleRequest(IWebRequestReader requestReader)

2021-04-11 20:40:01.559-05:00 [ 92] WARNING - SOAPRequesthandlerBase.HandleRequest: SOAP exception, SOAP fault: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:soap=“http://schemas.xmlsoap.org/soap/envelope/”>soap:Bodysoap:Faultsoap:ServerError processing message10000</soap:Fault></soap:Body></soap:Envelope>

I asked Milestone Development and they say that there is something wrong with GUID.

Maybe not serialized correctly if called from a self-made proxy.

Can you please verify if the GUID is correct?