ONVIF对操作"GetStatus"的回复消息主体进行反序列化时出错->字符串"1532531507"不是有效的AllXsd值 [英] ONVIF Error in deserializing body of reply message for operation 'GetStatus' -> The string '1532531507' is not a valid AllXsd value

查看:924
本文介绍了ONVIF对操作"GetStatus"的回复消息主体进行反序列化时出错->字符串"1532531507"不是有效的AllXsd值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上下文:

我正在制作一个c#Windows窗体应用程序,该应用程序使用onvif网站上提供的wsdls与ONVIF相机进行通讯.

I'm making a c# windows form app that communicates to ONVIF cameras using the wsdls given on the onvif site.

https://www.onvif.org/ver10/media/wsdl/media.wsdl

https://onvif.org/onvif/ver20/ptz/wsdl/ptz.wsdl

我能够在摄像机上获取配置文件,发送PTZ动作等,但是当我尝试获取我创建的ptzClient的状态时,出现错误:

I am able to get profiles on the camera, send PTZ action and more, but when I try to get the status of the ptzClient I created, I get the error:

Error in deserializing body of reply message for operation 'GetStatus'

我查看了此错误的innerException来查找:

I looked in the innerException of this error to find:

The string '1532531507' is not a valid AllXsd value.

这是我创建ptzClient的方式:

Here's how I create my ptzClient:

ServicePointManager.Expect100Continue = false;
var commonEncoding = new TextMessageEncodingBindingElement
                {
                    MessageVersion = MessageVersion.CreateVersion(EnvelopeVersion.Soap12, AddressingVersion.None)
                };
var commonBinding = new HttpTransportBindingElement
                {
                    AuthenticationScheme = AuthenticationSchemes.Digest
                };
var commonCustomBinding = new CustomBinding(commonEncoding, commonBinding);
var commonPasswordDigestBehavior = new PasswordDigestBehavior(userName, password);
var ptzEndpointAddress = new EndpointAddress($"http://{cameraAddress}/onvif/ptz");
ptzClient = new PTZClient(commonCustomBinding, ptzEndpointAddress);
ptzClient.Endpoint.EndpointBehaviors.Add(commonPasswordDigestBehavior);

调用以下代码行时发生错误:

The error happens when calling this line of code:

var p = ptzClient.GetStatus(profile.token);

当我在Wireshark中看到我的xml请求及其相应的xml响应时,我看到没有错误:

When I go see my xml request and its corresponding xml response in wireshark, I see that there is no error :

问题:

如何在不出现这些错误的情况下拨打电话?

How can I manage to make this call without getting these errors?

我没有什么可以改变的...

There isn't much I can change...

似乎问题出在日期格式,但我看不到更改此格式的方法.

It seems that the problem is from the date format, but I don't see a way to change this format.

推荐答案

要知道相机设备是否支持PTZ,可以在设备服务上调用GetCapabilities.

To Know whether the camera device supports PTZ, you can call GetCapabilities on device service.

GetCapabilities列表包含对实现类别中的接口操作的服务(在您的情况下为PTZ服务)地址(XAddr)的引用.如果GetCapabilities列表中未列出PTZ服务,则您的设备不支持PTZ.

The GetCapabilities list includes references to the addresses (XAddr) of the service(in your case it is PTZ service) implementing the interface operations in the category. If PTZ service is not listed in GetCapabilities list then PTZ is not supported by your device.

GetStatus api仅返回所选配置文件中节点的PTZ状态.

GetStatus api just returns PTZ status for the Node in the selected profile.

有一些ONVIF测试工具可用于在Windows平台上测试您的相机,从而简化了开发过程. http://www.happytimesoft.com/products/onvif-client/index. html

There are ONVIF test tools available to test your camera on windows platform to easy the development. http://www.happytimesoft.com/products/onvif-client/index.html

这篇关于ONVIF对操作"GetStatus"的回复消息主体进行反序列化时出错->字符串"1532531507"不是有效的AllXsd值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆