ONVIF:如何从 NVT 的 IP 地址形成设备 Web 服务地址

发布于 2024-09-16 14:37:58 字数 336 浏览 6 评论 0原文

我的问题是关于 ONVIF 规范的。 http://www.onvif.org/imwp/download.asp?ContentID=18006 在第 5.10 节中,它说:

服务是相关端口的集合。本规范不强制要求任何服务命名原则。

假设我有 NVT(网络视频传输器,例如 IP 摄像机)的 IP 地址,如何形成设备管理 Web 服务的地址?该服务是整个系统的入口点。

谢谢。

My question is about the ONVIF specification.
http://www.onvif.org/imwp/download.asp?ContentID=18006
In section 5.10, it says :

A service is a collection of related ports. This specification does not mandate any service naming principles.

Lets say that I have the IP address of an NVT (Network Video Transmitter like an IP camera for example), how do I form the address of the device management web service? This service is the entry point of the whole system.

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

萤火眠眠 2024-09-23 14:37:58

根据官方文档(第5.1.1节) ,您可以通过http:///onvif/device_service访问该服务

According to the official document (section 5.1.1), you can access the service at http://<IP address>/onvif/device_service

寄风 2024-09-23 14:37:58

您必须在 onvif xsdl 文件中添加服务(可以说 http://www .onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl

    <wsdl:definitions ......>
      ..............
         </wsdl:binding>
         <!--===============================-->
         <wsdl:service name="DeviceService">
             <wsdl:port name="DevicePort" binding="tds:DeviceBinding">
               <soap:address location="http://ip/onvif/device_service"/>
             </wsdl:port>
           </wsdl:service>
    </wsdl:definitions>

并生成ws客户端源代码
(对于 java 可以使用 wsimport )

正如前面提到的,webservice 的入口点是 http://ip/onvif/device_service

you have to add service in onvif xsdl file ( lets say http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl )

    <wsdl:definitions ......>
      ..............
         </wsdl:binding>
         <!--===============================-->
         <wsdl:service name="DeviceService">
             <wsdl:port name="DevicePort" binding="tds:DeviceBinding">
               <soap:address location="http://ip/onvif/device_service"/>
             </wsdl:port>
           </wsdl:service>
    </wsdl:definitions>

and generate ws client source code
( for java can use wsimport )

As was mentioned the entry point for webservice is http://ip/onvif/device_service

葵雨 2024-09-23 14:37:58

Şafak 指出的约定在 ONVIF 标准中进行了描述。但在现实生活中,有些设备并不遵循它。在这种情况下,您尝试发送单播 ws-discovery Probe 请求(或多播,然后按 ip 地址过滤 ProbeMatch 回复),ProbeMatch 回复中的 XAddrs 字段将包含设备服务所需的地址。

The convention pointed by Şafak is described in ONVIF standard. But in real life some devices does not follow it. In this case you try send unicast ws-discovery Probe request (or multicast and then filter ProbeMatch replies by ip-address), XAddrs field in ProbeMatch reply will contain the required address for device service.

姜生凉生 2024-09-23 14:37:58

请注意,在任何地方都使用 *http://IP/onvif/device_service* URL 来访问服务。根据 GetServices 请求:

<env:Body>
        <tds:GetServicesResponse>
            <tds:Service>
                <tds:Namespace>http://www.onvif.org/ver10/device/wsdl</tds:Namespace>
                <tds:XAddr>http://IP/onvif/device_service</tds:XAddr>
                <tds:Version>
                    <tt:Major>2</tt:Major>
                    <tt:Minor>10</tt:Minor>
                </tds:Version>
            </tds:Service>

            <tds:Service>
                <tds:Namespace>http://www.onvif.org/ver10/media/wsdl</tds:Namespace>
                <tds:XAddr>http://IP/onvif/Media</tds:XAddr>
                <tds:Version>
                    <tt:Major>2</tt:Major>
                    <tt:Minor>10</tt:Minor>
                </tds:Version>
            </tds:Service>

            <tds:Service>
                <tds:Namespace>http://www.onvif.org/ver10/events/wsdl</tds:Namespace>
                <tds:XAddr>http://IP/onvif/Events</tds:XAddr>
                <tds:Version>
                    <tt:Major>2</tt:Major>
                    <tt:Minor>10</tt:Minor>
                </tds:Version>
            </tds:Service>

            <tds:Service>
                <tds:Namespace>http://www.onvif.org/ver20/ptz/wsdl</tds:Namespace>
                <tds:XAddr>http://IP/onvif/PTZ</tds:XAddr>
                <tds:Version>
                    <tt:Major>2</tt:Major>
                    <tt:Minor>10</tt:Minor>
                </tds:Version>
            </tds:Service>

            <tds:Service>
                <tds:Namespace>http://www.onvif.org/ver20/imaging/wsdl</tds:Namespace>
                <tds:XAddr>http://IP/onvif/Imaging</tds:XAddr>
                <tds:Version>
                    <tt:Major>2</tt:Major>
                    <tt:Minor>10</tt:Minor>
                </tds:Version>
            </tds:Service>

            <tds:Service>
                <tds:Namespace>http://www.onvif.org/ver10/deviceIO/wsdl</tds:Namespace>
                <tds:XAddr>http://IP/onvif/DeviceIO</tds:XAddr>
                <tds:Version>
                    <tt:Major>2</tt:Major>
                    <tt:Minor>10</tt:Minor>
                </tds:Version>
            </tds:Service>

            <tds:Service>
                <tds:Namespace>http://www.onvif.org/ver20/analytics/wsdl</tds:Namespace>
                <tds:XAddr>http://IP/onvif/Analytics</tds:XAddr>
                <tds:Version>
                    <tt:Major>2</tt:Major>
                    <tt:Minor>10</tt:Minor>
                </tds:Version>
            </tds:Service>
        </tds:GetServicesResponse>

    </env:Body>

您可以在不同的 url 上拥有不同的服务。
这已经在海康威视的一台摄像机上看到了。其中大多数使用*http://IP/onvif/device_service*

Just be aware to use everywhere the *http://IP/onvif/device_service* url for reaching the services. According to GetServices request:

<env:Body>
        <tds:GetServicesResponse>
            <tds:Service>
                <tds:Namespace>http://www.onvif.org/ver10/device/wsdl</tds:Namespace>
                <tds:XAddr>http://IP/onvif/device_service</tds:XAddr>
                <tds:Version>
                    <tt:Major>2</tt:Major>
                    <tt:Minor>10</tt:Minor>
                </tds:Version>
            </tds:Service>

            <tds:Service>
                <tds:Namespace>http://www.onvif.org/ver10/media/wsdl</tds:Namespace>
                <tds:XAddr>http://IP/onvif/Media</tds:XAddr>
                <tds:Version>
                    <tt:Major>2</tt:Major>
                    <tt:Minor>10</tt:Minor>
                </tds:Version>
            </tds:Service>

            <tds:Service>
                <tds:Namespace>http://www.onvif.org/ver10/events/wsdl</tds:Namespace>
                <tds:XAddr>http://IP/onvif/Events</tds:XAddr>
                <tds:Version>
                    <tt:Major>2</tt:Major>
                    <tt:Minor>10</tt:Minor>
                </tds:Version>
            </tds:Service>

            <tds:Service>
                <tds:Namespace>http://www.onvif.org/ver20/ptz/wsdl</tds:Namespace>
                <tds:XAddr>http://IP/onvif/PTZ</tds:XAddr>
                <tds:Version>
                    <tt:Major>2</tt:Major>
                    <tt:Minor>10</tt:Minor>
                </tds:Version>
            </tds:Service>

            <tds:Service>
                <tds:Namespace>http://www.onvif.org/ver20/imaging/wsdl</tds:Namespace>
                <tds:XAddr>http://IP/onvif/Imaging</tds:XAddr>
                <tds:Version>
                    <tt:Major>2</tt:Major>
                    <tt:Minor>10</tt:Minor>
                </tds:Version>
            </tds:Service>

            <tds:Service>
                <tds:Namespace>http://www.onvif.org/ver10/deviceIO/wsdl</tds:Namespace>
                <tds:XAddr>http://IP/onvif/DeviceIO</tds:XAddr>
                <tds:Version>
                    <tt:Major>2</tt:Major>
                    <tt:Minor>10</tt:Minor>
                </tds:Version>
            </tds:Service>

            <tds:Service>
                <tds:Namespace>http://www.onvif.org/ver20/analytics/wsdl</tds:Namespace>
                <tds:XAddr>http://IP/onvif/Analytics</tds:XAddr>
                <tds:Version>
                    <tt:Major>2</tt:Major>
                    <tt:Minor>10</tt:Minor>
                </tds:Version>
            </tds:Service>
        </tds:GetServicesResponse>

    </env:Body>

You can have different services on different urls.
This has been seen on one of the HikVision cameras. Most of them uses the *http://IP/onvif/device_service*.

向日葵 2024-09-23 14:37:58

实际上,通过 WS-Discovery 您只能获取设备服务的地址。您必须使用 DeviceService:GetServices 请求获取的其他服务的地址,该请求与您之前通过 WS-Discovery 获取的地址 100% 有效。

Actually via the WS-Discovery you could only get address of device service. The addresses of the other services you must get with DeviceService:GetServices request which works 100% with address you got before with WS-Discovery.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文