本文介绍了ONVIF GetSystemDateAndTime请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一旦收到UDP多播请求的响应,便返回到239.255.255.250

Once I get a response back from the UDP Multicast Request to 239.255.255.250

我取回带有XAddrs http://10.10.10.10:1234/onvif/device_service

I get back a ProbeMatch with an XAddrs http://10.10.10.10:1234/onvif/device_service

现在如何执行GetSystemDateAndTime和GetDeviceInformation

How do I now do the GetSystemDateAndTime and GetDeviceInformation

这是对10.10.10.10端口1234的TCP/UDP请求吗?这是对10.10.10.10端口80的HTTP请求吗?

Is this a TCP/UDP request to 10.10.10.10 port 1234 ?Is this a HTTP request to 10.10.10.10 port 80 ?

或者一旦我拥有设备的地址http:10.10.10.10:1234/onvif/device_service

Or What Once I have the device's address http:10.10.10.10:1234/onvif/device_service

那又是什么

预先感谢

推荐答案

您只需向其中发送一个HTTP请求,因为SOAP可以通过HTTP进行工作.例如,通过CURL可能是这样的:

You need to send there just a HTTP request as SOAP works over HTTP. For example via CURL it would be like this:

curl 10.10.10.10:1234/onvif/device_service -d '<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><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>'

因此,您将获得带有某些标题的类似内容:

As a result you will get something like this with some headers:

<tds:GetSystemDateAndTimeResponse>
    <tds:SystemDateAndTime>
        <tt:DateTimeType>Manual</tt:DateTimeType>
        <tt:DaylightSavings>false</tt:DaylightSavings>
        <tt:TimeZone>
            <tt:TZ>MoroccoStandardTime0</tt:TZ>
        </tt:TimeZone>
        <tt:UTCDateTime>
            <tt:Time>
                <tt:Hour>10</tt:Hour>
                <tt:Minute>5</tt:Minute>
                <tt:Second>35</tt:Second>
            </tt:Time>
            <tt:Date>
                <tt:Year>2014</tt:Year>
                <tt:Month>3</tt:Month>
                <tt:Day>14</tt:Day>
            </tt:Date>
        </tt:UTCDateTime>
    </tds:SystemDateAndTime>
</tds:GetSystemDateAndTimeResponse>

也不要忘记,大多数操作都要求请求中包含授权标头.

And also dont forget that most of the actions requires authorization headers included in to the request.

身份验证

《 ONVIF应用程序程序员指南》中第35页上的描述了如何进行身份验证.例如,它看起来像这样:

In ONVIF Application Programmer's Guide on page 35 is described how auth is done. For example it looks like this:

<s:Header>
    <Security s:mustUnderstand="1" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
        <UsernameToken>
            <Username>admin</Username>
            <Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">MuMnyh3wTxGWOCc=</Password>
            <Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">8Qqve9KCkNhQAAAAAAA==</Nonce>
            <Created xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2014-03-04T14:03:05.130Z</Created>
        </UsernameToken>
    </Security>
</s:Header>

这篇关于ONVIF GetSystemDateAndTime请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 02:33
查看更多