faithoflifedev / easy_onvif_workspace

This package works with a variety of ONVIF compatible devices allowing for IP Cameras and NVRs (network video recorders) to be integrated into Dart and Flutter applications.
33 stars 19 forks source link

BUG: get-capabilities method is breaking for some cameras #53

Closed dinurymomshad closed 10 months ago

dinurymomshad commented 10 months ago

Error: type 'List<dynamic>' is not a subtype of type 'Map<String, dynamic>' in type cast

Error Log:

PS C:\Users\Admin\Documents\GitHub\Longshot-Flutter-App> onvif device-management get-capabilities --log-level all
πŸ‘» 03:12:00.437214 INFO     UI Loggy - Onvif - initializing ...
πŸ› 03:12:00.446215 DEBUG    UI Loggy - DeviceManagement - getSystemDateAndTime
πŸ› 03:12:00.491216 DEBUG    UI Loggy - LoggingInterceptors - URI: http://10.201.1.12/onvif/device_service
πŸ› 03:12:00.491216 DEBUG    UI Loggy - LoggingInterceptors - REQUEST:
<?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header/><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><GetSystemDateAndTime xmlns="
http://www.onvif.org/ver10/device/wsdl"/></s:Body></s:Envelope>
πŸ› 03:12:00.616230 DEBUG    UI Loggy - LoggingInterceptors - RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="htt
p://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" x
mlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xml
ns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-
200401-wss-wssecurity-secext-1.0.xsd" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xmime5="http://www.w3.org/2005/05/xmlmime" xmlns:xmime4="htt
p://www.w3.org/2004/11/xmlmime" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tds="http://ww
w.onvif.org/ver10/device/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tr2="ht
tp://www.onvif.org/ver20/media/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:tp
tz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:tptz1="http://www.onvif.org/ver10/ptz/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xml
ns:timg1="http://www.onvif.org/ver10/imaging/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tan="http://www.onvif.org/ver20/analyti
cs/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:extXsd="http://www.onvifext.org/ver10/extFunctions/wsdl" xmlns:tns1="http://www.onvi
f.org/ver10/topics" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tanae="http://www.onvif.org/ver20/analytics/wsdl/AnalyticsEngineBinding" xml
ns:tanre="http://www.onvif.org/ver20/analytics/wsdl/RuleEngineBinding">
        <SOAP-ENV:Body>
                <tds:GetSystemDateAndTimeResponse>
                        <tds:SystemDateAndTime>
                                <tt:DateTimeType>NTP</tt:DateTimeType>
                                <tt:DaylightSavings>false</tt:DaylightSavings>
                                <tt:TimeZone>
                                        <tt:TZ>CST+06:00</tt:TZ>
                                </tt:TimeZone>
                                <tt:UTCDateTime>
                                        <tt:Time>
                                                <tt:Hour>8</tt:Hour>
                                                <tt:Minute>35</tt:Minute>
                                                <tt:Second>21</tt:Second>
                                        </tt:Time>
                                        <tt:Date>
                                                <tt:Year>2024</tt:Year>
                                                <tt:Month>1</tt:Month>
                                                <tt:Day>8</tt:Day>
                                        </tt:Date>
                                </tt:UTCDateTime>
                                <tt:LocalDateTime>
                                        <tt:Time>
                                                <tt:Hour>2</tt:Hour>
                                                <tt:Minute>35</tt:Minute>
                                                <tt:Second>21</tt:Second>
                                        </tt:Time>
                                        <tt:Date>
                                                <tt:Year>2024</tt:Year>
                                                <tt:Month>1</tt:Month>
                                                <tt:Day>8</tt:Day>
                                        </tt:Date>
                                </tt:LocalDateTime>
                        </tds:SystemDateAndTime>
                </tds:GetSystemDateAndTimeResponse>
        </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

πŸ› 03:12:00.728234 DEBUG    UI Loggy - DeviceManagement - getServices
πŸ› 03:12:00.750238 DEBUG    UI Loggy - LoggingInterceptors - URI: http://10.201.1.12/onvif/device_service
πŸ› 03:12:00.751241 DEBUG    UI Loggy - LoggingInterceptors - REQUEST:
<?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header><Security xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-sec
ext-1.0.xsd" s:mustUnderstand="1"><UsernameToken><Username>admin</Username><Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-
username-token-profile-1.0#PasswordDigest">uUny1a0VNAh6rVRj1/LzhRtORr0=</Password><Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis
-200401-wss-soap-message-security-1.0#Base64Binary">b8kjGzOKvAGQZH5sI+qDbQ==</Nonce><Created xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-20
0401-wss-wssecurity-utility-1.0.xsd">2024-01-08T08:35:21.003999Z</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi="http://www.w3.or
g/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><GetServices xmlns="http://www.onvif.org/ver10/device/wsdl"><IncludeCapabil
ity>true</IncludeCapability></GetServices></s:Body></s:Envelope>
πŸ› 03:12:00.764238 DEBUG    UI Loggy - LoggingInterceptors - RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="htt
p://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" x
mlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xml
ns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-
200401-wss-wssecurity-secext-1.0.xsd" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xmime5="http://www.w3.org/2005/05/xmlmime" xmlns:xmime4="htt
p://www.w3.org/2004/11/xmlmime" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tds="http://ww
w.onvif.org/ver10/device/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tr2="ht
tp://www.onvif.org/ver20/media/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:tp
tz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:tptz1="http://www.onvif.org/ver10/ptz/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xml
ns:timg1="http://www.onvif.org/ver10/imaging/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tan="http://www.onvif.org/ver20/analyti
cs/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:extXsd="http://www.onvifext.org/ver10/extFunctions/wsdl" xmlns:tns1="http://www.onvi
f.org/ver10/topics" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tanae="http://www.onvif.org/ver20/analytics/wsdl/AnalyticsEngineBinding" xml
ns:tanre="http://www.onvif.org/ver20/analytics/wsdl/RuleEngineBinding">
        <SOAP-ENV:Body>
                <tds:GetServicesResponse>
                        <tds:Service>
                                <tds:Namespace>http://www.onvif.org/ver10/device/wsdl</tds:Namespace>
                                <tds:XAddr>http://10.201.1.12:80/onvif/device_service</tds:XAddr>
                                <tds:Capabilities>
                                        <tds:Capabilities>
                                                <tds:Network IPFilter="false" ZeroConfiguration="false" IPVersion6="false" DynDNS="false" Dot11Conf
iguration="false" Dot1XConfigurations="0" HostnameFromDHCP="true" NTP="1" DHCPv6="false"></tds:Network>
                                                <tds:Security TLS1.0="false" TLS1.1="false" TLS1.2="false" OnboardKeyGeneration="false" AccessPolic
yConfig="false" DefaultAccessPolicy="true" Dot1X="false" RemoteUserHandling="false" X.509Token="false" SAMLToken="false" KerberosToken="false" User
nameToken="false" HttpDigest="false" RELToken="false" SupportedEAPMethods="0" MaxUsers="10" MaxUserNameLength="32" MaxPasswordLength="16"></tds:Sec
urity>
                                                <tds:System DiscoveryResolve="false" DiscoveryBye="true" RemoteDiscovery="false" SystemBackup="fals
e" SystemLogging="true" FirmwareUpgrade="true" HttpFirmwareUpgrade="true" HttpSystemBackup="false" HttpSystemLogging="false" HttpSupportInformation
="false" StorageConfiguration="true" MaxStorageConfigurations="8"></tds:System>
                                                </tds:Capabilities>
                                        </tds:Capabilities>
                                <tds:Version>
                                        <tt:Major>17</tt:Major>
                                        <tt:Minor>6</tt:Minor>
                                </tds:Version>
                        </tds:Service>
                        <tds:Service>
                                <tds:Namespace>http://www.onvif.org/ver10/media/wsdl</tds:Namespace>
                                <tds:XAddr>http://10.201.1.12:80/onvif/Media</tds:XAddr>
                                <tds:Capabilities><trt:Capabilities SnapshotUri="true" Rotation="false" VideoSourceMode="false" OSD="true" EXICompr
ession="false"><trt:ProfileCapabilities MaximumNumberOfProfiles="2"></trt:ProfileCapabilities><trt:StreamingCapabilities RTPMulticast="false" RTP_T
CP="false" RTP_RTSP_TCP="true" NonAggregateControl="true"></trt:StreamingCapabilities></trt:Capabilities></tds:Capabilities><tds:Version>
                                        <tt:Major>17</tt:Major>
                                        <tt:Minor>6</tt:Minor>
                                </tds:Version>
                        </tds:Service>
                        <tds:Service>
                                <tds:Namespace>http://www.onvif.org/ver20/imaging/wsdl</tds:Namespace>
                                <tds:XAddr>http://10.201.1.12:80/onvif/Imaging</tds:XAddr>
                                <tds:Capabilities>
                                <timg:Capabilities ImageStabilization="false" Presets="false"></timg:Capabilities>
                                </tds:Capabilities>
                                <tds:Version>
                                        <tt:Major>17</tt:Major>
                                        <tt:Minor>6</tt:Minor>
                                </tds:Version>
                        </tds:Service>
                        <tds:Service><tds:Namespace>http://www.onvif.org/ver10/events/wsdl</tds:Namespace>
                                <tds:XAddr>http://10.201.1.12:80/onvif/Events</tds:XAddr>
                                <tds:Capabilities>
                                        <tev:Capabilities WSSubscriptionPolicySupport="true" WSPullPointSupport="true" WSPausableSubscriptionManage
rInterfaceSupport="false" MaxNotificationProducers="5" MaxPullPoints="5" PersistentNotificationStorage="false">
                                </tev:Capabilities>
                                        </tds:Capabilities>
                                <tds:Version>
                                        <tt:Major>17</tt:Major>
                                        <tt:Minor>6</tt:Minor>
                                </tds:Version>
                        </tds:Service>
                        <tds:Service>
                                <tds:Namespace>http://www.onvif.org/ver20/analytics/wsdl</tds:Namespace>
                                <tds:XAddr>http://10.201.1.12:80/onvif/Analytics</tds:XAddr>
                                <tds:Capabilities><tan:Capabilities RuleSupport="true" AnalyticsModuleSupport="true" CellBasedSceneDescriptionSuppo
rted="true"></tan:Capabilities></tds:Capabilities>
                                <tds:Version>
                                        <tt:Major>17</tt:Major>
                                        <tt:Minor>6</tt:Minor>
                                </tds:Version>
                                </tds:Service>
                        <tds:Service>
                                <tds:Namespace>http://www.onvif.org/ver20/media/wsdl</tds:Namespace>
                                <tds:XAddr>http://10.201.1.12:80/onvif/Media20</tds:XAddr>
                                <tds:Capabilities>
<tr2:Capabilities SnapshotUri="true" Rotation="false" VideoSourceMode="false" OSD="true" Mask="true">
<tr2:ProfileCapabilities MaximumNumberOfProfiles="10" ConfigurationsSupported="VideoSource AudioSource VideoEncoder AudioEncoder AudioOutput AudioD
ecoder PTZ"></tr2:ProfileCapabilities>
<tr2:StreamingCapabilities RTSPStreaming="true" RTPMulticast="false" RTP_RTSP_TCP="true" NonAggregateControl="false"></tr2:StreamingCapabilities>  
</tr2:Capabilities>
</tds:Capabilities>
<tds:Version>
                                        <tt:Major>17</tt:Major>
                                        <tt:Minor>6</tt:Minor>
                                </tds:Version>
                        </tds:Service>
                        <tds:Service>
                                <tds:Namespace>http://www.onvif.org/ver20/ptz/wsdl</tds:Namespace>
                                <tds:XAddr>http://10.201.1.12:80/onvif/ptz_service</tds:XAddr>
                                <tds:Capabilities>
                                        <tptz:Capabilities EFlip="false" Reverse="false" GetCompatibleConfigurations="false" MoveStatus="true" Stat
usPosition="true" />
                                </tds:Capabilities>
                                <tds:Version>
                                        <tt:Major>17</tt:Major>
                                        <tt:Minor>6</tt:Minor>
                                </tds:Version>
                        </tds:Service>
                </tds:GetServicesResponse>
        </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

πŸ‘» 03:12:00.793242 INFO     UI Loggy - Onvif - initialization complete
πŸ› 03:12:00.794242 DEBUG    UI Loggy - DeviceManagement - getCapabilities
πŸ› 03:12:00.795243 DEBUG    UI Loggy - LoggingInterceptors - URI: http://10.201.1.12/onvif/device_service
πŸ› 03:12:00.795243 DEBUG    UI Loggy - LoggingInterceptors - REQUEST:
<?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header/><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><GetCapabilities xmlns="http:
//www.onvif.org/ver10/device/wsdl"><Category>All</Category></GetCapabilities></s:Body></s:Envelope>
πŸ› 03:12:00.802240 DEBUG    UI Loggy - LoggingInterceptors - RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="htt
p://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" x
mlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xml
ns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-
200401-wss-wssecurity-secext-1.0.xsd" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xmime5="http://www.w3.org/2005/05/xmlmime" xmlns:xmime4="htt
p://www.w3.org/2004/11/xmlmime" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tds="http://ww
w.onvif.org/ver10/device/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tr2="ht
tp://www.onvif.org/ver20/media/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:tp
tz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:tptz1="http://www.onvif.org/ver10/ptz/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xml
ns:timg1="http://www.onvif.org/ver10/imaging/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tan="http://www.onvif.org/ver20/analyti
cs/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:extXsd="http://www.onvifext.org/ver10/extFunctions/wsdl" xmlns:tns1="http://www.onvi
f.org/ver10/topics" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tanae="http://www.onvif.org/ver20/analytics/wsdl/AnalyticsEngineBinding" xml
ns:tanre="http://www.onvif.org/ver20/analytics/wsdl/RuleEngineBinding">
        <SOAP-ENV:Body>
                <tds:GetCapabilitiesResponse>
                        <tds:Capabilities>
                                <tt:Analytics>
                                        <tt:XAddr>http://10.201.1.12:80/onvif/Analytics_service</tt:XAddr>
                                        <tt:RuleSupport>true</tt:RuleSupport>
                                        <tt:AnalyticsModuleSupport>true</tt:AnalyticsModuleSupport>
                                </tt:Analytics>
                                <tt:Device>
                                        <tt:XAddr>http://10.201.1.12:80/onvif/Device_service</tt:XAddr>
                                        <tt:Network>
                                                <tt:IPFilter>false</tt:IPFilter>
                                                <tt:ZeroConfiguration>false</tt:ZeroConfiguration>
                                                <tt:IPVersion6>false</tt:IPVersion6>
                                                <tt:DynDNS>false</tt:DynDNS>
                                        </tt:Network>
                                        <tt:System>
                                                <tt:DiscoveryResolve>false</tt:DiscoveryResolve>
                                                <tt:DiscoveryBye>true</tt:DiscoveryBye>
                                                <tt:RemoteDiscovery>false</tt:RemoteDiscovery>
                                                <tt:SystemBackup>false</tt:SystemBackup>
                                                <tt:SystemLogging>false</tt:SystemLogging>
                                                <tt:FirmwareUpgrade>true</tt:FirmwareUpgrade>
                                                <tt:SupportedVersions>
                                                        <tt:Major>2</tt:Major>
                                                        <tt:Minor>0</tt:Minor>
                                                </tt:SupportedVersions>
                                                <tt:SupportedVersions>
                                                        <tt:Major>2</tt:Major>
                                                        <tt:Minor>11</tt:Minor>
                                                </tt:SupportedVersions>
                                                <tt:SupportedVersions>
                                                        <tt:Major>2</tt:Major>
                                                        <tt:Minor>21</tt:Minor>
                                                </tt:SupportedVersions>
                                                <tt:SupportedVersions>
                                                        <tt:Major>2</tt:Major>
                                                        <tt:Minor>40</tt:Minor>
                                                </tt:SupportedVersions>
                                                <tt:SupportedVersions>
                                                        <tt:Major>2</tt:Major>
                                                        <tt:Minor>50</tt:Minor>
                                                </tt:SupportedVersions>
                                                <tt:SupportedVersions>
                                                        <tt:Major>2</tt:Major>
                                                        <tt:Minor>60</tt:Minor>
                                                </tt:SupportedVersions>
                                                <tt:SupportedVersions>
                                                        <tt:Major>16</tt:Major>
                                                        <tt:Minor>6</tt:Minor>
                                                </tt:SupportedVersions>
                                                <tt:SupportedVersions>
                                                        <tt:Major>16</tt:Major>
                                                        <tt:Minor>12</tt:Minor>
                                                </tt:SupportedVersions>
                                                <tt:SupportedVersions>
                                                        <tt:Major>17</tt:Major>
                                                        <tt:Minor>6</tt:Minor>
                                                </tt:SupportedVersions>
                                        </tt:System>
                                        <tt:IO>
                                                <tt:InputConnectors>1</tt:InputConnectors>
                                                <tt:RelayOutputs>1</tt:RelayOutputs>
                                        </tt:IO>
                                        <tt:Security>
                                                <tt:TLS1.1>false</tt:TLS1.1>
                                                <tt:TLS1.2>false</tt:TLS1.2>
                                                <tt:OnboardKeyGeneration>false</tt:OnboardKeyGeneration>
                                                <tt:AccessPolicyConfig>false</tt:AccessPolicyConfig>
                                                <tt:X.509Token>false</tt:X.509Token>
                                                <tt:SAMLToken>false</tt:SAMLToken>
                                                <tt:KerberosToken>false</tt:KerberosToken>
                                                <tt:RELToken>false</tt:RELToken>
                                                <tt:Extension>
                                                        <tt:TLS1.0>false</tt:TLS1.0>
                                                        <tt:Extension>
                                                                <tt:Dot1X>false</tt:Dot1X>
                                                                <tt:SupportedEAPMethod>0</tt:SupportedEAPMethod>
                                                                <tt:RemoteUserHandling>false</tt:RemoteUserHandling>
                                                        </tt:Extension>
                                                </tt:Extension>
                                        </tt:Security>
                                </tt:Device>
                                <tt:Events>
                                        <tt:XAddr>http://10.201.1.12:80/onvif/Events</tt:XAddr>
                                        <tt:WSSubscriptionPolicySupport>true</tt:WSSubscriptionPolicySupport>
                                        <tt:WSPullPointSupport>true</tt:WSPullPointSupport>
                                        <tt:WSPausableSubscriptionManagerInterfaceSupport>false</tt:WSPausableSubscriptionManagerInterfaceSupport> 
                                </tt:Events>
                                <tt:Imaging>
                                        <tt:XAddr>http://10.201.1.12:80/onvif/Imaging</tt:XAddr>
                                </tt:Imaging>
                                <tt:Media>
                                        <tt:XAddr>http://10.201.1.12:80/onvif/Media</tt:XAddr>
                                        <tt:StreamingCapabilities>
                                                <tt:RTPMulticast>false</tt:RTPMulticast>
                                                <tt:RTP_TCP>false</tt:RTP_TCP>
                                                <tt:RTP_RTSP_TCP>true</tt:RTP_RTSP_TCP>
                                        </tt:StreamingCapabilities>
                                </tt:Media>
                                <tt:Media>
Unhandled exception:
type 'List<dynamic>' is not a subtype of type 'Map<String, dynamic>' in type cast
#0      _$CapabilitiesFromJson (package:easy_onvif/src/model/device_management/capabilities.g.dart:26:54)
#1      new Capabilities.fromJson (package:easy_onvif/src/model/device_management/capabilities.dart:54:7)
#2      _$GetCapabilitiesResponseFromJson (package:easy_onvif/src/model/device_management/get_capabilities_response.g.dart:13:24)
#3      new GetCapabilitiesResponse.fromJson (package:easy_onvif/src/model/device_management/get_capabilities_response.dart:20:7)
#4      DeviceManagement.getCapabilities (package:easy_onvif/src/device_management.dart:92:36)
<asynchronous suspension>
#5      OnvifGetCapabilitiesDeviceManagementCommand.run (package:easy_onvif/src/cmd/onvif_device_management_command.dart:211:28)
<asynchronous suspension>
#6      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
faithoflifedev commented 10 months ago

@dinurymomshad,

Fixed in the latest release. It looks like your device has multiple media elements in the GetCapabilitiesResponse, which doesn't follow the Onvif spec. I don't have a device to test with, so I'll need your feedback on whether these changes resolve the issue.

dinurymomshad commented 10 months ago

Here is the log for latest update:

πŸ‘» 00:47:56.928539 INFO     UI Loggy - Onvif - initializing ...
πŸ› 00:47:56.934539 DEBUG    UI Loggy - DeviceManagement - getSystemDateAndTime
πŸ› 00:47:56.982571 DEBUG    UI Loggy - LoggingInterceptors - URI: http://10.201.1.11/onvif/device_service
πŸ› 00:47:56.984568 DEBUG    UI Loggy - LoggingInterceptors - REQUEST:
<?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header/><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><GetSystemDateAndTime xmlns="
http://www.onvif.org/ver10/device/wsdl"/></s:Body></s:Envelope>
πŸ› 00:47:57.107576 DEBUG    UI Loggy - LoggingInterceptors - RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="htt
p://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" x
mlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xml
ns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-
200401-wss-wssecurity-secext-1.0.xsd" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xmime5="http://www.w3.org/2005/05/xmlmime" xmlns:xmime4="htt
p://www.w3.org/2004/11/xmlmime" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tds="http://ww
w.onvif.org/ver10/device/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tr2="ht
tp://www.onvif.org/ver20/media/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:tp
tz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:tptz1="http://www.onvif.org/ver10/ptz/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xml
ns:timg1="http://www.onvif.org/ver10/imaging/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tan="http://www.onvif.org/ver20/analyti
cs/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:extXsd="http://www.onvifext.org/ver10/extFunctions/wsdl" xmlns:tns1="http://www.onvi
f.org/ver10/topics" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tanae="http://www.onvif.org/ver20/analytics/wsdl/AnalyticsEngineBinding" xml
ns:tanre="http://www.onvif.org/ver20/analytics/wsdl/RuleEngineBinding">
        <SOAP-ENV:Body>
                <tds:GetSystemDateAndTimeResponse>
                        <tds:SystemDateAndTime>
                                <tt:DateTimeType>NTP</tt:DateTimeType>
                                <tt:DaylightSavings>false</tt:DaylightSavings>
                                <tt:TimeZone>
                                        <tt:TZ>CST-08:00</tt:TZ>
                                </tt:TimeZone>
                                <tt:UTCDateTime>
                                        <tt:Time>
                                                <tt:Hour>14</tt:Hour>
                                                <tt:Minute>59</tt:Minute>
                                                <tt:Second>20</tt:Second>
                                        </tt:Time>
                                        <tt:Date>
                                                <tt:Year>2024</tt:Year>
                                                <tt:Month>1</tt:Month>
                                                <tt:Day>6</tt:Day>
                                        </tt:Date>
                                </tt:UTCDateTime>
                                <tt:LocalDateTime>
                                        <tt:Time>
                                                <tt:Hour>22</tt:Hour>
                                                <tt:Minute>59</tt:Minute>
                                                <tt:Second>20</tt:Second>
                                        </tt:Time>
                                        <tt:Date>
                                                <tt:Year>2024</tt:Year>
                                                <tt:Month>1</tt:Month>
                                                <tt:Day>6</tt:Day>
                                        </tt:Date>
                                </tt:LocalDateTime>
                        </tds:SystemDateAndTime>
                </tds:GetSystemDateAndTimeResponse>
        </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

πŸ› 00:47:57.207584 DEBUG    UI Loggy - DeviceManagement - getServices
πŸ› 00:47:57.224583 DEBUG    UI Loggy - LoggingInterceptors - URI: http://10.201.1.11/onvif/device_service
πŸ› 00:47:57.224583 DEBUG    UI Loggy - LoggingInterceptors - REQUEST:
<?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header><Security xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-sec
ext-1.0.xsd" s:mustUnderstand="1"><UsernameToken><Username>admin</Username><Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-
username-token-profile-1.0#PasswordDigest">sBmyVIJ+zejRqxoroAo+L9LIHqw=</Password><Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis
-200401-wss-soap-message-security-1.0#Base64Binary">y7PJ7W8aYrKBeL2QYQNN4A==</Nonce><Created xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-20
0401-wss-wssecurity-utility-1.0.xsd">2024-01-06T14:59:20.005001Z</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi="http://www.w3.or
g/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><GetServices xmlns="http://www.onvif.org/ver10/device/wsdl"><IncludeCapabil
ity>true</IncludeCapability></GetServices></s:Body></s:Envelope>
πŸ› 00:47:57.234586 DEBUG    UI Loggy - LoggingInterceptors - RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="htt
p://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" x
mlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xml
ns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-
200401-wss-wssecurity-secext-1.0.xsd" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xmime5="http://www.w3.org/2005/05/xmlmime" xmlns:xmime4="htt
p://www.w3.org/2004/11/xmlmime" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tds="http://ww
w.onvif.org/ver10/device/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tr2="ht
tp://www.onvif.org/ver20/media/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:tp
tz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:tptz1="http://www.onvif.org/ver10/ptz/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xml
ns:timg1="http://www.onvif.org/ver10/imaging/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tan="http://www.onvif.org/ver20/analyti
cs/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:extXsd="http://www.onvifext.org/ver10/extFunctions/wsdl" xmlns:tns1="http://www.onvi
f.org/ver10/topics" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tanae="http://www.onvif.org/ver20/analytics/wsdl/AnalyticsEngineBinding" xml
ns:tanre="http://www.onvif.org/ver20/analytics/wsdl/RuleEngineBinding">
        <SOAP-ENV:Body>
                <tds:GetServicesResponse>
                        <tds:Service>
                                <tds:Namespace>http://www.onvif.org/ver10/device/wsdl</tds:Namespace>
                                <tds:XAddr>http://10.201.1.11:80/onvif/device_service</tds:XAddr>
                                <tds:Capabilities>
                                        <tds:Capabilities>
                                                <tds:Network IPFilter="false" ZeroConfiguration="false" IPVersion6="false" DynDNS="false" Dot11Conf
iguration="false" Dot1XConfigurations="0" HostnameFromDHCP="true" NTP="1" DHCPv6="false"></tds:Network>
                                                <tds:Security TLS1.0="false" TLS1.1="false" TLS1.2="false" OnboardKeyGeneration="false" AccessPolic
yConfig="false" DefaultAccessPolicy="true" Dot1X="false" RemoteUserHandling="false" X.509Token="false" SAMLToken="false" KerberosToken="false" User
nameToken="false" HttpDigest="false" RELToken="false" SupportedEAPMethods="0" MaxUsers="10" MaxUserNameLength="32" MaxPasswordLength="16"></tds:Sec
urity>
                                                <tds:System DiscoveryResolve="false" DiscoveryBye="true" RemoteDiscovery="false" SystemBackup="fals
e" SystemLogging="true" FirmwareUpgrade="true" HttpFirmwareUpgrade="true" HttpSystemBackup="false" HttpSystemLogging="false" HttpSupportInformation
="false" StorageConfiguration="true" MaxStorageConfigurations="8"></tds:System>
                                                </tds:Capabilities>
                                        </tds:Capabilities>
                                <tds:Version>
                                        <tt:Major>17</tt:Major>
                                        <tt:Minor>6</tt:Minor>
                                </tds:Version>
                        </tds:Service>
                        <tds:Service>
                                <tds:Namespace>http://www.onvif.org/ver10/media/wsdl</tds:Namespace>
                                <tds:XAddr>http://10.201.1.11:80/onvif/Media</tds:XAddr>
                                <tds:Capabilities><trt:Capabilities SnapshotUri="true" Rotation="false" VideoSourceMode="false" OSD="true" EXICompr
ession="false"><trt:ProfileCapabilities MaximumNumberOfProfiles="2"></trt:ProfileCapabilities><trt:StreamingCapabilities RTPMulticast="false" RTP_T
CP="false" RTP_RTSP_TCP="true" NonAggregateControl="true"></trt:StreamingCapabilities></trt:Capabilities></tds:Capabilities><tds:Version>
                                        <tt:Major>17</tt:Major>
                                        <tt:Minor>6</tt:Minor>
                                </tds:Version>
                        </tds:Service>
                        <tds:Service>
                                <tds:Namespace>http://www.onvif.org/ver20/imaging/wsdl</tds:Namespace>
                                <tds:XAddr>http://10.201.1.11:80/onvif/Imaging</tds:XAddr>
                                <tds:Capabilities>
                                <timg:Capabilities ImageStabilization="false" Presets="false"></timg:Capabilities>
                                </tds:Capabilities>
                                <tds:Version>
                                        <tt:Major>17</tt:Major>
                                        <tt:Minor>6</tt:Minor>
                                </tds:Version>
                        </tds:Service>
                        <tds:Service><tds:Namespace>http://www.onvif.org/ver10/events/wsdl</tds:Namespace>
                                <tds:XAddr>http://10.201.1.11:80/onvif/Events</tds:XAddr>
                                <tds:Capabilities>
                                        <tev:Capabilities WSSubscriptionPolicySupport="true" WSPullPointSupport="true" WSPausableSubscriptionManage
rInterfaceSupport="false" MaxNotificationProducers="5" MaxPullPoints="5" PersistentNotificationStorage="false">
                                </tev:Capabilities>
                                        </tds:Capabilities>
                                <tds:Version>
                                        <tt:Major>17</tt:Major>
                                        <tt:Minor>6</tt:Minor>
                                </tds:Version>
                        </tds:Service>
                        <tds:Service>
                                <tds:Namespace>http://www.onvif.org/ver20/analytics/wsdl</tds:Namespace>
                                <tds:XAddr>http://10.201.1.11:80/onvif/Analytics</tds:XAddr>
                                <tds:Capabilities><tan:Capabilities RuleSupport="true" AnalyticsModuleSupport="true" CellBasedSceneDescriptionSuppo
rted="true"></tan:Capabilities></tds:Capabilities>
                                <tds:Version>
                                        <tt:Major>17</tt:Major>
                                        <tt:Minor>6</tt:Minor>
                                </tds:Version>
                                </tds:Service>
                        <tds:Service>
                                <tds:Namespace>http://www.onvif.org/ver20/media/wsdl</tds:Namespace>
                                <tds:XAddr>http://10.201.1.11:80/onvif/Media20</tds:XAddr>
                                <tds:Capabilities>
<tr2:Capabilities SnapshotUri="true" Rotation="false" VideoSourceMode="false" OSD="true" Mask="true">
<tr2:ProfileCapabilities MaximumNumberOfProfiles="10" ConfigurationsSupported="VideoSource AudioSource VideoEncoder AudioEncoder AudioOutput AudioD
ecoder PTZ"></tr2:ProfileCapabilities>
<tr2:StreamingCapabilities RTSPStreaming="true" RTPMulticast="false" RTP_RTSP_TCP="true" NonAggregateControl="false"></tr2:StreamingCapabilities>  
</tr2:Capabilities>
</tds:Capabilities>
<tds:Version>
                                        <tt:Major>17</tt:Major>
                                        <tt:Minor>6</tt:Minor>
                                </tds:Version>
                        </tds:Service>
                        <tds:Service>
                                <tds:Namespace>http://www.onvif.org/ver20/ptz/wsdl</tds:Namespace>
                                <tds:XAddr>http://10.201.1.11:80/onvif/ptz_service</tds:XAddr>
                                <tds:Capabilities>
                                        <tptz:Capabilities EFlip="false" Reverse="false" GetCompatibleConfigurations="false" MoveStatus="true" Stat
usPosition="true" />
                                </tds:Capabilities>
                                <tds:Version>
                                        <tt:Major>17</tt:Major>
                                        <tt:Minor>6</tt:Minor>
                                </tds:Version>
                        </tds:Service>
                </tds:GetServicesResponse>
        </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

πŸ‘» 00:47:57.261887 INFO     UI Loggy - Onvif - initialization complete
πŸ› 00:47:57.262887 DEBUG    UI Loggy - DeviceManagement - getCapabilities
πŸ› 00:47:57.263886 DEBUG    UI Loggy - LoggingInterceptors - URI: http://10.201.1.11/onvif/device_service
πŸ› 00:47:57.263886 DEBUG    UI Loggy - LoggingInterceptors - REQUEST:
<?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header/><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><GetCapabilities xmlns="http:
//www.onvif.org/ver10/device/wsdl"><Category>All</Category></GetCapabilities></s:Body></s:Envelope>
πŸ› 00:47:57.276889 DEBUG    UI Loggy - LoggingInterceptors - RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="htt
p://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" x
mlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xml
ns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-
200401-wss-wssecurity-secext-1.0.xsd" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xmime5="http://www.w3.org/2005/05/xmlmime" xmlns:xmime4="htt
p://www.w3.org/2004/11/xmlmime" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tds="http://ww
w.onvif.org/ver10/device/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tr2="ht
tp://www.onvif.org/ver20/media/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:tp
tz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:tptz1="http://www.onvif.org/ver10/ptz/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xml
ns:timg1="http://www.onvif.org/ver10/imaging/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tan="http://www.onvif.org/ver20/analyti
cs/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:extXsd="http://www.onvifext.org/ver10/extFunctions/wsdl" xmlns:tns1="http://www.onvi
f.org/ver10/topics" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tanae="http://www.onvif.org/ver20/analytics/wsdl/AnalyticsEngineBinding" xml
ns:tanre="http://www.onvif.org/ver20/analytics/wsdl/RuleEngineBinding">
        <SOAP-ENV:Body>
                <tds:GetCapabilitiesResponse>
                        <tds:Capabilities>
                                <tt:Analytics>
                                        <tt:XAddr>http://10.201.1.11:80/onvif/Analytics_service</tt:XAddr>
                                        <tt:RuleSupport>true</tt:RuleSupport>
                                        <tt:AnalyticsModuleSupport>true</tt:AnalyticsModuleSupport>
                                </tt:Analytics>
                                <tt:Device>
                                        <tt:XAddr>http://10.201.1.11:80/onvif/Device_service</tt:XAddr>
                                        <tt:Network>
                                                <tt:IPFilter>false</tt:IPFilter>
                                                <tt:ZeroConfiguration>false</tt:ZeroConfiguration>
                                                <tt:IPVersion6>false</tt:IPVersion6>
                                                <tt:DynDNS>false</tt:DynDNS>
                                        </tt:Network>
                                        <tt:System>
                                                <tt:DiscoveryResolve>false</tt:DiscoveryResolve>
                                                <tt:DiscoveryBye>true</tt:DiscoveryBye>
                                                <tt:RemoteDiscovery>false</tt:RemoteDiscovery>
                                                <tt:SystemBackup>false</tt:SystemBackup>
                                                <tt:SystemLogging>false</tt:SystemLogging>
                                                <tt:FirmwareUpgrade>true</tt:FirmwareUpgrade>
                                                <tt:SupportedVersions>
                                                        <tt:Major>2</tt:Major>
                                                        <tt:Minor>0</tt:Minor>
                                                </tt:SupportedVersions>
                                                <tt:SupportedVersions>
                                                        <tt:Major>2</tt:Major>
                                                        <tt:Minor>11</tt:Minor>
                                                </tt:SupportedVersions>
                                                <tt:SupportedVersions>
                                                        <tt:Major>2</tt:Major>
                                                        <tt:Minor>21</tt:Minor>
                                                </tt:SupportedVersions>
                                                <tt:SupportedVersions>
                                                        <tt:Major>2</tt:Major>
                                                        <tt:Minor>40</tt:Minor>
                                                </tt:SupportedVersions>
                                                <tt:SupportedVersions>
                                                        <tt:Major>2</tt:Major>
                                                        <tt:Minor>50</tt:Minor>
                                                </tt:SupportedVersions>
                                                <tt:SupportedVersions>
                                                        <tt:Major>2</tt:Major>
                                                        <tt:Minor>60</tt:Minor>
                                                </tt:SupportedVersions>
                                                <tt:SupportedVersions>
                                                        <tt:Major>16</tt:Major>
                                                        <tt:Minor>6</tt:Minor>
                                                </tt:SupportedVersions>
                                                <tt:SupportedVersions>
                                                        <tt:Major>16</tt:Major>
                                                        <tt:Minor>12</tt:Minor>
                                                </tt:SupportedVersions>
                                                <tt:SupportedVersions>
                                                        <tt:Major>17</tt:Major>
                                                        <tt:Minor>6</tt:Minor>
                                                </tt:SupportedVersions>
                                        </tt:System>
                                        <tt:IO>
                                                <tt:InputConnectors>1</tt:InputConnectors>
                                                <tt:RelayOutputs>1</tt:RelayOutputs>
                                        </tt:IO>
                                        <tt:Security>
                                                <tt:TLS1.1>false</tt:TLS1.1>
                                                <tt:TLS1.2>false</tt:TLS1.2>
                                                <tt:OnboardKeyGeneration>false</tt:OnboardKeyGeneration>
                                                <tt:AccessPolicyConfig>false</tt:AccessPolicyConfig>
                                                <tt:X.509Token>false</tt:X.509Token>
                                                <tt:SAMLToken>false</tt:SAMLToken>
                                                <tt:KerberosToken>false</tt:KerberosToken>
                                                <tt:RELToken>false</tt:RELToken>
                                                <tt:Extension>
                                                        <tt:TLS1.0>false</tt:TLS1.0>
                                                        <tt:Extension>
                                                                <tt:Dot1X>false</tt:Dot1X>
                                                                <tt:SupportedEAPMethod>0</tt:SupportedEAPMethod>
                                                                <tt:RemoteUserHandling>false</tt:RemoteUserHandling>
                                                        </tt:Extension>
                                                </tt:Extension>
                                        </tt:Security>
                                </tt:Device>
                                <tt:Events>
                                        <tt:XAddr>http://10.201.1.11:80/onvif/Events</tt:XAddr>
                                        <tt:WSSubscriptionPolicySupport>true</tt:WSSubscriptionPolicySupport>
                                        <tt:WSPullPointSupport>true</tt:WSPullPointSupport>
                                        <tt:WSPausableSubscriptionManagerInterfaceSupport>false</tt:WSPausableSubscriptionManagerInterfaceSupport> 
                                </tt:Events>
                                <tt:Imaging>
                                        <tt:XAddr>http://10.201.1.11:80/onvif/Imaging</tt:XAddr>
                                </tt:Imaging>
                                <tt:Media>
                                        <tt:XAddr>http://10.201.1.11:80/onvif/Media</tt:XAddr>
                                        <tt:StreamingCapabilities>
                                                <tt:RTPMulticast>false</tt:RTPMulticast>
                                                <tt:RTP_TCP>false</tt:RTP_TCP>
                                                <tt:RTP_RTSP_TCP>true</tt:RTP_RTSP_TCP>
                                        </tt:StreamingCapabilities>
                                </tt:Media>
                                <tt:Media>
                                        <tt:XAddr>http://10.201.1.11:80/onvif/Media20</tt:XAddr>
                                        <tt:StreamingCapabilities>
                                                <tt:RTPMulticast>false</tt:RTPMulticast>
                                                <tt:RTP_TCP>false</tt:RTP_TCP>
                                                <tt:RTP_RTSP_TCP>true</tt:RTP_RTSP_TCP>
                                        </tt:StreamingCapabilities>
                                </tt:Media>
                                <tt:PTZ>
                                                <tt:XAddr>http://10.201.1.11:80/onvif/ptz</tt:XAddr>
                                                </tt:PTZ>
                                                <tt:Extension>
                                        <tt:DeviceIO>
                                                <tt:XAddr>http://10.201.1.11:80/onvif/DeviceIO</tt:XAddr>
                                                <tt:VideoSources>1</tt:VideoSources>
                                                <tt:VideoOutputs>1</tt:VideoOutputs>
                                                <tt:AudioSources>1</tt:AudioSources>
                                                <tt:AudioOutputs>1</tt:AudioOutputs>
                                                <tt:RelayOutputs>1</tt:RelayOutputs>
                                        </tt:DeviceIO>
                                </tt:Extension>
                        </tds:Capabilities>
                </tds:GetCapabilitiesResponse>
        </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Unhandled exception:
type 'List<dynamic>' is not a subtype of type 'Map<String, dynamic>' in type cast
#0      _$CapabilitiesFromJson (package:easy_onvif/src/model/device_management/capabilities.g.dart:26:54)
#1      new Capabilities.fromJson (package:easy_onvif/src/model/device_management/capabilities.dart:54:7)
#2      _$GetCapabilitiesResponseFromJson (package:easy_onvif/src/model/device_management/get_capabilities_response.g.dart:13:24)
#3      new GetCapabilitiesResponse.fromJson (package:easy_onvif/src/model/device_management/get_capabilities_response.dart:20:7)
#4      DeviceManagement.getCapabilities (package:easy_onvif/src/device_management.dart:92:36)
<asynchronous suspension>
#5      OnvifGetCapabilitiesDeviceManagementCommand.run (package:easy_onvif/src/cmd/onvif_device_management_command.dart:211:28)
<asynchronous suspension>
#6      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
faithoflifedev commented 10 months ago

Hi @dinurymomshad ,

Are you sure you're running the latest version easy_onvif: ^2.1.3+13?

I added the following test: (where GetCapabilitiesResponse.xml is the response you provided above)

group('unknown', () {
  test('GetCapabilitiesResponse', () {
    final response = File(
            'test/xml/unknown/device_management/GetCapabilitiesResponse.xml')
        .readAsStringSync();

    final envelope = Envelope.fromXml(response);

    expect(
        GetCapabilitiesResponse.fromJson(envelope.body.response!)
            .capabilities
            .device
            ?.xAddr,
        'http://10.201.1.11:80/onvif/Device_service');
  });
});

So it's looking like the latest release is able to parse the response correctly.

dinurymomshad commented 10 months ago

Hi @dinurymomshad ,

Are you sure you're running the latest version easy_onvif: ^2.1.3+13?

I added the following test: (where GetCapabilitiesResponse.xml is the response you provided above)

group('unknown', () {
  test('GetCapabilitiesResponse', () {
    final response = File(
            'test/xml/unknown/device_management/GetCapabilitiesResponse.xml')
        .readAsStringSync();

    final envelope = Envelope.fromXml(response);

    expect(
        GetCapabilitiesResponse.fromJson(envelope.body.response!)
            .capabilities
            .device
            ?.xAddr,
        'http://10.201.1.11:80/onvif/Device_service');
  });
});

So it's looking like the latest release is able to parse the response correctly.

Yes, we can close this issue as done. Thanks