对于 Onvif 配置文件 G 设备,CreateRecording 失败并显示 "The RecordConfiguration is invalid"

CreateRecording fails with "The RecordConfiguration is invalid" for Onvif Profile G device

我正在尝试在 Profile G 设备上创建录音;

请求正文如下:

<SOAP-ENV:Body>
<recording:CreateRecording>
<recording:RecordingConfiguration xsi:type="onv:RecordingConfiguration">
<onv:Source xsi:type="onv:RecordingSourceInformation">
<onv:SourceId>http://10.65.158.165/onvif/recording_service</onv:SourceId>
<onv:Name>BSONIRecName</onv:Name>
<onv:Location>BSONIRecLocation</onv:Location>
<onvescription>BSONIRecDescription</onvescription>
<onv:Address>http://10.65.158.165/onvif/recording_service</onv:Address>
</onv:Source>
<onv:Content>BSONIRecContent</onv:Content>
<onv:MaximumRetentionTime>100</onv:MaximumRetentionTime>
</recording:RecordingConfiguration>
</recording:CreateRecording>
</SOAP-ENV:Body>

但是,我总是收到错误提示

<env:Code>
<env:Value>env:Sender</env:Value>
<env:Subcode>
<env:Value>ter:InvalidArgVal</env:Value>
<env:Subcode>
<env:Value>ter:BadConfiguration</env:Value>
</env:Subcode>
</env:Subcode>
</env:Code>
<env:Reason>
<env:Text xml:lang="en">The RecordConfiguration is invalid.</env:Text>
</env:Reason>

谁能看看,请求格式有什么问题吗?

MaximumRetentionTime 类型不匹配,它是 xs:duration 类型,而不是简单的数字字符串。

因此将此参数更改为 "P7D" 即可解决问题。