Re: 500 error while GetResponse()



Hi Kevin,

I'll try to explain it again:

I have developed an ASP.Net application - www.ABC.com

Now i want to develop a utility which checks whether my site is up or not.
If it is not then i need to send an SMS alert to few people to check the
status of the site.

This utility is a console app which makes a HTTPRequest to - www.ABC.com
So, the point at which i say - GetResponse() - i.e. when i'm trying to get
the response of the request i made to my site, its giving me a
System.WebException - "The remote server returned an error: (500) Internal
Server Error."

Hope i'm able to explain the problem in a better way this time.

Thanks,
Pooja.

"Kevin Spencer" wrote:

> > HttpWebResponse webresponse = (HttpWebResponse)wrGETURL.GetResponse();
> >
> > I get an error when GetResponse() is executed. The error is :
> >
> > "The remote server returned an error: (500) Internal Server Error."
>
> This question is a bit confusing. It sounds like you're saying that the line
> that executes the GetResponse method is throwing an error. However, you say
> that the error is "The remote server returned an error: (500) Internal
> Server Error." Now, as you're developing an ASP.Net application, this could
> mean one of 2 things:
>
> 1. The Response contains a 500 status code.
> 2. Your ASP.Net Page is displaying a 500 status code.
>
> The first would mean that the server that your WebRequest sent a Request to
> has a problem.
> The second would mean that your ASP.Net app has a problem.
>
> If your app is not the one having a problem, where are you seeing this
> error? An HttpWebResponse will contain the status code and other information
> about the success or failure of the Request. But if the problem is in your
> app, you need to be more specific about how you're getting this error
> information.
>
> Can you clear this issue up?
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> Neither a follower nor a lender be.
>
> "Pooja" <Pooja@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:F44641B7-19FF-4E2B-B863-14F44FC99B53@xxxxxxxxxxxxxxxx
> > Hi All,
> >
> > I'm trying to make a web request to my site from some other ASP.Net
> > Application. Code used for that is:
> >
> > string sURL = "<my site url>";
> >
> > HttpWebRequest wrGETURL = (HttpWebRequest) WebRequest.Create(new
> > Uri(sURL));
> >
> > wrGETURL.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0;
> > .NET CLR 1.1.4322)";
> >
> > wrGETURL.AllowAutoRedirect = true;
> > wrGETURL.CookieContainer = new CookieContainer();
> >
> > wrGETURL.CookieContainer.Add(new Uri(sURL), new Cookie("bhResults",
> > "bhtz=0"));
> >
> > wrGETURL.CookieContainer.Add(new Uri(sURL), new Cookie("bhPrevResults",
> > "bhtz=0"));
> >
> > HttpWebResponse webresponse = (HttpWebResponse)wrGETURL.GetResponse();
> >
> > I get an error when GetResponse() is executed. The error is :
> >
> > "The remote server returned an error: (500) Internal Server Error."
> >
> > Any ideas why i'm getting this error?
> >
> > Thnx in advance.
> > Pooja.
>
>
>
.



Relevant Pages

  • Re: Writing Files asynchronously
    ... > I have a classic app that uses FSWrite to store text into a file. ... > app will hang indefinitely. ... > So I went looking for a way to kill off the pending I/O request. ...
    (comp.sys.mac.programmer.codewarrior)
  • Re: 500 error while GetResponse()
    ... You would of course need to handle any Exception thrown by this method with ... >> The first would mean that the server that your WebRequest sent a Request ... >> The second would mean that your ASP.Net app has a problem. ... >> ..Net Developer ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Catching NPEs
    ... I have developed an app along these lines. ... Unexpected exceptions are caught and rethrown. ... Request servicing continues, and doesn't even diminish in capacity since the thread that dies is recreated immediately unless it's no longer needed anyway. ... Since it's a network using app, most exceptions are I/O exceptions that get handled closer to the source, usually by sending the client an error message and moving on to the next request; they tend to indicate a problem with connectivity or the client having sent a bad or malformed request that includes a bogus URL, parse error, or similarly. ...
    (comp.lang.java.programmer)
  • Re: Web listener
    ... When the request comes in from CGI the app connects to D3 ... running the web server on the MV server can be/is a security risk. ...
    (comp.databases.pick)
  • =?Utf-8?Q?SBS2003_-_Some_websites_don=C2=B4t_wo?= =?Utf-8?Q?rk?=
    ... The current error page you are seeing can be replaced by a custom ... Server Error in '/Backup' Application. ... Exception Details: System.UnauthorizedAccessException: Access to the path ... granting access rights to the resource to the ASP.NET request identity. ...
    (microsoft.public.windows.server.sbs)