Internal Server Error



I am using only windows authentication for webpage access (anonymous access
removed) to read a page. I am using this code to read a page and then use
the StreamReader to convert the Page to PDF.

Private Function GetHTML(ByVal sUrl As String) As StreamReader
Dim oReq As HttpWebRequest
Dim oResp As HttpWebResponse = Nothing
Dim lTime As Long = Now.Ticks

oReq = HttpWebRequest.Create(sUrl)
oReq.Credentials = CredentialCache.DefaultCredentials ........ <- I
wonder whether it takes Domain Credentials here
oResp = oReq.GetResponse ........ here <-System.Net.WebException:
The remote server returned an error: (500) Internal Server Error

Dim sr As New StreamReader(oResp.GetResponseStream)
Return sr
End Function

why does this happens? what settings i need to have?
I guess I have all the right permissions set, I even have <identity
impersonate = "true"> if i set it to "false", I get insufficient permissions

Please Advice,

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question