ONVIF Request GetSystemDateAndTime

As soon as I get a response from a UDP multicast request to 239.255.255.250

I am returning ProbeMatch using XAddrs http://10.10.10.10:1234/onvif/device_service

How do I do GetSystemDateAndTime and GetDeviceInformation

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

Or that I have a device address http:10.10.10.10:1234/onvif/device_service

What then

Thanks in advance

+7
onvif
source share
3 answers

You only need to send an HTTP request there, since SOAP works through HTTP. For example, through CURL it will look 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 remember that most actions require the authorization headers included in the request.

AUTHENTICATION

The ONVIF Application Programming Guide on page 35 describes how auth is performed. 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> 
+8
source share

@Kirix solution does not work for my camera. However, after a huge amount of code study and errors / errors. I decided that the Trendnet camera I insist on is perfect for the title. I figured out a curl variation:

 curl http://192.168.xxx.xxx/onvif/device_service --data '<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>' --header 'Content-Type: application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver10/device/wsdl/GetSystemDateAndTime";' 
+2
source share

In your case, http://10.10.10.10:1234/onvif/device_service is the address of the device management service. You need to send a GetSystemDateAndTime request in accordance with the SOAP protocol.

How to send such requests depends on the system you are working on. You can use Visual Studio or gsoap (there is an ONVIF FAQ )

0
source share

All Articles