Re: How to import XML RSS though proxy with authentication



On Mar 24, 3:14 pm, "ThatsIT.net.au" <me@thatsit> wrote:
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

.



Relevant Pages

  • Re: ADSI Problem
    ... If you are doing forms authentication using ADSI (which it sounds like you ... Do you know how I can also the script to make it work all the time. ... Restarting IIS usually gets it working again. ... Dim strUserName ...
    (microsoft.public.windows.server.active_directory)
  • Re: ADSI Problem
    ... Right I've got the script working now with my ASP applications by passing the ... If you are doing forms authentication using ADSI (which it sounds like you ... Restarting IIS usually gets it working again. ... Dim strUserName ...
    (microsoft.public.windows.server.active_directory)
  • Re: socket error
    ... It ended up with something to do with our Proxy configuration. ... but on the 2.0 box for some reason the httpwebrequest couldnt ... Yes I can visit that page directly through a browser on the server. ... >> | Dim returnstr As String ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ADSI Problem
    ... built in mechanisms to support forms-based authentication are the way to go. ... In a .NET web app, you generally discover the identity of the authenticated ... Unfortunately, script and ASP 3.0 are not my things, so I'm not the expert ... Dim strUserName ...
    (microsoft.public.windows.server.active_directory)
  • The remote server returned an error: (404) Not Found
    ... I am facing an Exception "The remote server returned an error: ... by using "getRequestStream" method of HttpWebRequest object to send data. ... Dim strPostData As New StringBuilder ... Dim objWebRequest As HttpWebRequest = ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)