'407 Proxy Authentication Required'

Mar 4, 2008 at 4:52 PM
Hi all,

I am getting this error when I run the application. Following is the stack trace of the error :

Server Error in '/Dropthings' Application.
--------------------------------------------------------------------------------

The remote server returned an error: (407) Proxy Authentication Required.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.

Source Error:


Line 74:
Line 75: XmlDocument doc = Cacheurl as XmlDocument ?? (new XmlDocument());
Line 76: if (!doc.HasChildNodes) doc.Load(url);
Line 77: if (null == Cacheurl) Cacheurl = doc;
Line 78:


Source File: c:\ports\dropthings-9681\trunk\Dropthings\Widgets\WeatherWidget.ascx.cs Line: 76

Stack Trace:


WebException: The remote server returned an error: (407) Proxy Authentication Required.
System.Net.HttpWebRequest.GetResponse() +1532114
System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials) +61
System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials) +1925036
System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) +51
System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver) +44
System.Threading.CompressedStack.runTryCode(Object userData) +54
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) +0
System.Threading.CompressedStack.Run(CompressedStack compressedStack, ContextCallback callback, Object state) +174
System.Xml.XmlTextReaderImpl.OpenUrl() +199
System.Xml.XmlTextReaderImpl.Read() +53
System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) +145
System.Xml.XmlDocument.Load(XmlReader reader) +96
System.Xml.XmlDocument.Load(String filename) +160
Widgets_WeatherWidget.GetWeatherData() in c:\ports\dropthings-9681\trunk\Dropthings\Widgets\WeatherWidget.ascx.cs:76
Widgets_WeatherWidget.OnPreRender(EventArgs e) in c:\ports\dropthings-9681\trunk\Dropthings\Widgets\WeatherWidget.ascx.cs:45
System.Web.UI.Control.PreRenderRecursiveInternal() +86
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
Mar 14, 2008 at 1:59 PM
Hello, try this:

WebProxy webProxy = new WebProxy("host", 8080);
webProxy.Credentials = CredentialCache.DefaultCredentials;
WebRequest.DefaultWebProxy = webProxy;