How to import XML RSS though proxy with authentication

  • Thread starter Thread starter ThatsIT.net.au
  • Start date Start date
T

ThatsIT.net.au

I have asp.net application behind a ISA 2000 Server
I have a few pages that import RSS, recently I have had to set
authentication for out going requests though the proxy server, how do I set
authentication for the XmlDocument or XPathDocument object
I have done the same thing in classic asp using

set objXMLHTTP = Server.CreateObject("MSXML2.SERVERXMLHTTP")
objXMLHTTP.Open "GET", XMLRSS, false,"username","password"

how to do it in asp.net?
 
I have asp.net application behind a ISA 2000 Server
I have a few pages that import RSS, recently I have had to set
authentication for out going requests though the proxy server, how do I set
authentication for the XmlDocument or XPathDocument object
I have done the same thing in classic asp using

set objXMLHTTP = Server.CreateObject("MSXML2.SERVERXMLHTTP")
objXMLHTTP.Open "GET", XMLRSS, false,"username","password"

how to do it in asp.net?

You may need to run the proxycfg.exe tool to work, but I'd recommend
instead use managed HttpWebRequest class

Dim myProxy As New WebProxy("...", True)
myProxy.Credentials = New NetworkCredential("user", "password",
"domain")

Dim XMLRSS As String = "..."
Dim myHttpWebRequest As HttpWebRequest = CType(WebRequest.Create(url),
HttpWebRequest)
myHttpWebRequest.Proxy = myProxy
....

http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest(VS.71).aspx
 
Back
Top