GetStatus and GetCurrentDeviceStatus response only includes 1 CameraDeviceStatus

Hi,

I am developing python program that is using zeep to create Client for SOAP requests.

I followed the following steps in retrieving the camera status changes, patterned from StatusDemoConsole:

  1. Generate Soap Token

  2. Start session

  3. Subscribe CameraDeviceStatus

  4. Poll status using GetStatus

  5. Close session

I have 3 cameras, and subscribed in all cameras.

However, the response from GetStatus always returned 1 CameraDeviceStatus in CameraDeviceStatusArray

I also tried GetCurrentDeviceStatus, still returned only 1 CameraDeviceStatus in CameraDeviceStatusArray

I tried testing it in Postman but returns as expected 3 CameraDeviceStatuses, since it subscribed in all 3 cameras.

cameraIds = ['8c4f7697-1909-4a84-b1cf-8468a7c45e30', '59de063e-6e87-4db7-9109-95f5b962ca42']
 
uri = urlparse(webServerUri)
recorder_status = Client(f"{uri.scheme}://{uri.hostname}:{uri.port}/RecorderStatusService/RecorderStatusService2.asmx?wsdl")
 
status_session = recorder_status.service.StartStatusSession(token=token)
recorder_status.service.SubscribeDeviceStatus(token=token, statusSessionId=status_session, deviceIds=cameraIds)
 
while True:
        statuses = recorder_status.service.GetStatus(token=token,
                                                                statusSessionId=status_session,
                                                                millisecondsTimeout=5000)
       
       print(f"CameraDeviceStatusArray {len(statuses.CameraDeviceStatusArray)}") #Here always returns 1 CameraDeviceStatus only

Any thoughts on this? Thanks

The StatusDemoConsole is not working from our machine, the error is “Could not logon to management server”

A small first step. The StatusDemoConsole has per default secureOnly = True, (program.cs, line 40). This means it will not work if the site is not setup using encrypted communication. Please set this to False, verify that you use the correct adddress for the server, correct credentials, and retry. Can the sample login and do you get the same issue using the sample?

Thanks, it is all working now and I can see all the 3 CameraDeviceStatus once it started.

The zeep client implementation was patterned from this program https://github.com/joshooaj/PythonLib/blob/main/test.py

Running the same code into our server, also returns 1 CameraDeviceStatus only

I managed to resolved the issue by extracting the complexType then add the deviceIds on it.

For reference on any protocol integration using python, you can implement like this especially when trying to add item on Array type like guids.

guids = statusService.get_type('ns0:ArrayOfGuid')
deviceIds = []
for camera in info.Cameras.CameraInfo:
    deviceIds.append(camera.DeviceId)
status = statusService.service.GetCurrentDeviceStatus(token=token, deviceIds=guids(deviceIds))
print(f"{len(status.CameraDeviceStatusArray)}")

The get_type method, extracts the ArrayOfGuid type and returns a function.

Then add a list of items into the function, guids(deviceIds)

I am pleased to hear you solved it.