Digest Authentication using WebRequest

Dim myCache As New CredentialCache()

Dim request As Net.HttpWebRequest = Nothing

Dim response As HttpWebResponse = Nothing

Dim sURL as string = "http://www.xxx.com/cgi-bin/fwcamimg.cgi?FwModId=0&PortId=0&FwCgiVer=0x0001"

request = CType(WebRequest.Create(sURL), HttpWebRequest)
request.Timeout = 30000
request.Method = "GET"
request.PreAuthenticate = True
myCache.Add(New Uri(sURL), "Digest", New Net.NetworkCredential(m_UserName, m_UserPass))
request.Credentials = myCache

response = CType(request.GetResponse(), HttpWebResponse)

Whenever i try to run this code in .Net CF 2 SP2 , it throw exception of

"The response did not contain an end of entity mark."

Can anybody help or .NetCF 2 SP 2 not support http digest authentication because it is working under normal .Net program which i wrote to test it...

Thanks

Jason


[1245 byte] By [JasonLiew] at [2008-1-1]
# 1

Hi Jason,

Digest authentication is supported in NETCF V2 SP2. Would it be possible for you to send a small piece of code containing a test credential that reproduces the issue so that we can investigate it further? Also, a stack trace would be helpful as well. You can send the code to anthony.wong@microsoft.com.

Thanks,

Anthony Wong [MSFT]

AnthonyWong-MSFT at 2007-9-12 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 2
Hi,

I am having the same error as the original user ... the problem is, I believe, because the server I am connecting to is an embedded device called an AudioTron, and it is sending back something that HTTPWebRequest thinks is malformed. I know it does not send back HTML; I am not sure what headers it sends back.

Is there any way to make HttpWebRequest more tolerant, and just send me the stream it got back regardless of what it thinks is the "end of entity mark" ?

--Chris

wz2b at 2007-9-12 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...