您需要爲SOAP工程通過HTTP發送那裏只是一個HTTP請求。例如通過捲曲它會是這樣:
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>'
結果,你會得到這樣一些標題:
<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>
而且也不要忘記,大多數的行動需要包括授權頭進入請求。
認證35頁
在ONVIF Application Programmer's Guide描述AUTH是怎麼做的。例如,它看起來像這樣:
<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>
來源
2014-03-14 10:08:06
Kin
我知道GetSystemDateAndTimeResponse不需要驗證。你有一個需要用戶名/密碼的命令的捲曲示例? –
@RoundSparrowhilltx邑,只是片刻,我會更新我的帖子... – Kin
很酷,謝謝。 –