要从符合 ONVIF 标准的设备检索事件,您需要使用 ONVIF 事件 wsdl。
ONVIF FAQ & Support page 中提到了以下内容:
Visual Studio 2008, 2010 and 2012 generate web services clients for the WCF framework with a tool called svcutil.exe. This tool has an issue by mapping port types to interfaces and complex types to classes. When an wsdl file contains a port type and complex type with same name this results in a name clash at compile time like "The namespace 'foo.Event' already contains a definition for 'CreatePullPoint' ".
作为解决方法,他们编辑了 events.wsdl 以使用修改后的 ws 基本通知文件,该文件可通过 this 获得。链接。
但是,当我将 wsdl 文件添加到我的解决方案中时,出现错误,指出找不到 wsdl 文件中的以下行中提到的文件
<wsdl:import namespace="http://docs.oasis-open.org/wsn/bw-2" location="bw-2-vs-mod.wsdl"/> <!-- Use modified OASIS file to avoid svcutil name clash -->
当我浏览到 http://docs.oasis-open.org/wsn/ 时并手动查找该文件,我可以看到它也没有在那里列出。该文件是否还有其他位置?
最佳答案
提供的 WSDL 链接 here不正确并且缺少一个字符。正确的网址是http://www.onvif.org/onvif/ver10/events/wsdl/event-vs.wsdl 。使用此 URL 为我解决了命名空间错误。
关于c# - 新的 onvif 事件 wsdl 仍未修复?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29764619/