By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,871 Members | 2,418 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,871 IT Pros & Developers. It's quick & easy.

System.Net.Webexecption on WebRequest.GetResponse

P: n/a
Hi Everybody,

after a while, i´ve had to maintain a ASP.NET/C# project, where
during processing of an request, the same (local!) webserver is
requested again for the response of a corresponding aspx-page.

Something like this:

....
string uri = 'http://localhost/appname/secondpage.aspx?ItemId=4711';
WebRequest req = WebRequest.Create( uri );
req.Credentials = CredentialCache.DefaultCredentials;
WebResponse resp = req.GetResponse();
Stream st = req.GetResponseStream;
....

This worked fine on my machine a few month ago, as well as on my
collegues machine and alos at the customer.
On all 3 machines, the local IIS instance is responsible to process
the aspx-Request (two XP-SP2, one W2k-Server).

Acutally, when i perform this again, i´ll get a
System.Net.Webexecption
on the execution of "req.GetResponse()" with following error-stack

System.Net.HttpWebRequest.CheckFinalStatus()
System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult asyncResult)
System.Net.HttpWebRequest.CheckFinalStatus()
myModule.myMethod()
etc. ...

This error appears also, when i replace the uri above f.e. with
'http://www.google.com'.
Even when i run a downloaded, ready-to-use C#-sample (EXE, not
ASP.NET!),
i´ll get this error.

On my collegues machine, the same things still works fine, even on the
customers
server, but i´m not able to test/debug this one on my machine anymore.

I don´t know, what could be the reason for it.
My XP´s configuration seems very identical to my collegues one.
Also my XP Servicepack´s, Patches and .NET-Version look identical to
my
collegue ones.
But there must be a difference!

Does anyone has any idea, that maybe can keep me away from a complete
reinstallation of my machine?

Thanks in advance,

Thomas
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
This exception is also thrown if the statuscode is 404 for example. Have a
look at this:

<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemnetwebrequestclassendgetresponsetopic.a sp>

--
Daniel Fisher(lennybacon)
MCP ASP.NET C#
Blog: http://www.lennybacon.com/
"Thomas Geisel" <tg*****@symax.de> wrote in message
news:b4************************@posting.google.com ...
Hi Everybody,

after a while, i´ve had to maintain a ASP.NET/C# project, where
during processing of an request, the same (local!) webserver is
requested again for the response of a corresponding aspx-page.

Something like this:

...
string uri = 'http://localhost/appname/secondpage.aspx?ItemId=4711';
WebRequest req = WebRequest.Create( uri );
req.Credentials = CredentialCache.DefaultCredentials;
WebResponse resp = req.GetResponse();
Stream st = req.GetResponseStream;
...

This worked fine on my machine a few month ago, as well as on my
collegues machine and alos at the customer.
On all 3 machines, the local IIS instance is responsible to process
the aspx-Request (two XP-SP2, one W2k-Server).

Acutally, when i perform this again, i´ll get a
System.Net.Webexecption
on the execution of "req.GetResponse()" with following error-stack

System.Net.HttpWebRequest.CheckFinalStatus()
System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult asyncResult)
System.Net.HttpWebRequest.CheckFinalStatus()
myModule.myMethod()
etc. ...

This error appears also, when i replace the uri above f.e. with
'http://www.google.com'.
Even when i run a downloaded, ready-to-use C#-sample (EXE, not
ASP.NET!),
i´ll get this error.

On my collegues machine, the same things still works fine, even on the
customers
server, but i´m not able to test/debug this one on my machine anymore.

I don´t know, what could be the reason for it.
My XP´s configuration seems very identical to my collegues one.
Also my XP Servicepack´s, Patches and .NET-Version look identical to
my
collegue ones.
But there must be a difference!

Does anyone has any idea, that maybe can keep me away from a complete
reinstallation of my machine?

Thanks in advance,

Thomas

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.