我尝试向 ONVIF 摄像机发送 SetHostName 请求,但无法正确发出请求,并且总是收到错误消息。 请帮助我。
'''
<?xml
version='1.0'
encoding='utf-8'
?>
<soap-env:Envelope
xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope">
<soap-env:Header>
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>
admin
</wsse:Username>
<wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">
gfdsgfsgfsgfs
</wsse:Password>
<wsse:Nonce
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">
fdsgfdsgfsdfgsd
</wsse:Nonce>
<wsu:Created
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
2024-01-17T14:03:35+00:00
</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soap-env:Header>
<soap-env:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tds:SetHostname xmlns="http://www.onvif.org/ver10/device/wsdl">
<tds:HostnameInformation>
<tt:Name>NewHostname1234</tt:Name>
</tds:HostnameInformation>
</tds:SetHostname>
</soap-env:Body>
</soap-env:Envelope>'''
我看到有几个人还在关注这个帖子。以下是我如何使用curl 检索主机名。当然,更改您设备的 IP 和端口。它必须是一根连续的字符串才能工作。
curl http://192.168.1.40:8899/onvif/device_service --data '