rvi / ONVIFCameraAndroid

Example on how to connect to an ONVIF camera on Android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

401 Unauthorized

a-bellezza opened this issue · comments

Hi, i'm having an issue while using the library version: 1.1.9

I get "HTTP Error: 401 Unauthorized" response while i try to use the getProfile method.
Here is the request and the response i see logged:

------------------REQUEST:-------------------------
URL:
http://192.168.1.167:888/onvif/device_service

Headers:
Content-Type text/xml; charset=utf-8
Authorization Digest username="ad-2020@", realm="realm", nonce="nonce", uri="/onvif/device_service", response="1204fe0080c5377e7c5f99d80e788ff8", cnonce="a1b390a149f9085d64598b75f3a9e0f1", nc=00000001, qop="auth"Digest username="ad-2020@", uri="/onvif/device_service", response="1204fe0080c5377e7c5f99d80e788ff8", cnonce="a1b390a149f9085d64598b75f3a9e0f1", nc=00000001, qop="auth"

Body:

<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://www.w3.org/2003/05/soap-envelope" >
soap:Body

false

</soap:Body>
</soap:Envelope>

------------------------ Response -----------------------------

Header
WWW-Authenticate: Basic realm="gSOAP Web Service"
Server: gSOAP
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 1654
Connection: close

BODY

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery"
xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex"
xmlns:wsa5="http://www.w3.org/2005/08/addressing"
xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
xmlns:wsc="http://schemas.xmlsoap.org/ws/2005/02/sc"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:xmime="http://tempuri.org/xmime.xsd"
xmlns:xop="http://www.w3.org/2004/08/xop/include"
xmlns:tt="http://www.onvif.org/ver10/schema"
xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2"
xmlns:wstop="http://docs.oasis-open.org/wsn/t-1"
xmlns:tdn="http://www.onvif.org/ver10/network/wsdl"
xmlns:tds="http://www.onvif.org/ver10/device/wsdl"
xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl"
xmlns:trt="http://www.onvif.org/ver10/media/wsdl">
SOAP-ENV:Body
SOAP-ENV:Fault
SOAP-ENV:Code
SOAP-ENV:ValueSOAP-ENV:Sender</SOAP-ENV:Value>
</SOAP-ENV:Code>
SOAP-ENV:Reason
<SOAP-ENV:Text xml:lang="en">HTTP Error: 401 Unauthorized</SOAP-ENV:Text>
</SOAP-ENV:Reason>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Sorry for the late reply, somehow, github notifications are going to my spam folder.

Probably a wrong login/password if you have a 401.