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

Application_Error function is not invoked when an System.Web.HttpException: Request timed out occurs

P: n/a
Dear All,
I have a web Application "http://localhost/Web/WebForm1.aspx" that
calls a WebService from
"http://localhost/webserviceapp/service1.asmx"...I have set the
executionTimeout to 10 secs in Web.Config where my WebService is
installed.
<httpRuntime executionTimeout="10" appRequestQueueLimit="2" />

When I call a method "TestPlan" which takes more than 10 secs my web
Page gets the following error:
Error: Client found response content type of 'text/html;
charset=utf-8', but expected 'text/xml'. The request failed with the
error message: --
Server Error in '/WebServiceApp' Application.
Exception Details: System.Web.HttpException: Request timed out.
I tried to trap the error on Application_Error function of Global.asax
of both my Web page and the WebService...
Sub Application_Error(ByVal sender As Object, _
ByVal e As EventArgs)
' Get the actual error that brought us here
Dim ex As Exception = _
Server.GetLastError.InnerException
' Display basic error information
Response.Write("An error occurred in the application:<br>")
Response.Write(ex.Message & "<br>")
Response.Write("Stack trace:<br>")
Dim s As StringBuilder = New StringBuilder(ex.StackTrace)
Response.Write(s.Replace(" at ", " at<br> "))
Response.End()
' Clear the error
Server.ClearError()
End Sub
But it did not work...I tried to trap the event on the Page's onError
method too it did not work...could someone please help...

TALIA

Many Regards
Jack
Nov 18 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Jack Wright" <su***@volcanomail.com> wrote in message
news:8f**************************@posting.google.c om...
Dear All,
I have a web Application "http://localhost/Web/WebForm1.aspx" that
calls a WebService from
"http://localhost/webserviceapp/service1.asmx"...I have set the
executionTimeout to 10 secs in Web.Config where my WebService is
installed.
<httpRuntime executionTimeout="10" appRequestQueueLimit="2" />

When I call a method "TestPlan" which takes more than 10 secs my web
Page gets the following error:
Error: Client found response content type of 'text/html;
charset=utf-8', but expected 'text/xml'. The request failed with the
error message: --
Server Error in '/WebServiceApp' Application.
Exception Details: System.Web.HttpException: Request timed out.
I tried to trap the error on Application_Error function of Global.asax
of both my Web page and the WebService...
Sub Application_Error(ByVal sender As Object, _
ByVal e As EventArgs)
' Get the actual error that brought us here
Dim ex As Exception = _
Server.GetLastError.InnerException
' Display basic error information
Response.Write("An error occurred in the application:<br>")
Response.Write(ex.Message & "<br>")
Response.Write("Stack trace:<br>")
Dim s As StringBuilder = New StringBuilder(ex.StackTrace)
Response.Write(s.Replace(" at ", " at<br> "))
Response.End()
' Clear the error
Server.ClearError()
End Sub
But it did not work...I tried to trap the event on the Page's onError
method too it did not work...could someone please help...

TALIA

Many Regards
Jack

Nov 18 '05 #2

P: n/a
Not yet...wot do I do?

Please help...

TALIA

Many Regards
Jack

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message news:<uF**************@tk2msftngp13.phx.gbl>...
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Jack Wright" <su***@volcanomail.com> wrote in message
news:8f**************************@posting.google.c om...
Dear All,
I have a web Application "http://localhost/Web/WebForm1.aspx" that
calls a WebService from
"http://localhost/webserviceapp/service1.asmx"...I have set the
executionTimeout to 10 secs in Web.Config where my WebService is
installed.
<httpRuntime executionTimeout="10" appRequestQueueLimit="2" />

When I call a method "TestPlan" which takes more than 10 secs my web
Page gets the following error:
Error: Client found response content type of 'text/html;
charset=utf-8', but expected 'text/xml'. The request failed with the
error message: --
Server Error in '/WebServiceApp' Application.
Exception Details: System.Web.HttpException: Request timed out.
I tried to trap the error on Application_Error function of Global.asax
of both my Web page and the WebService...
Sub Application_Error(ByVal sender As Object, _
ByVal e As EventArgs)
' Get the actual error that brought us here
Dim ex As Exception = _
Server.GetLastError.InnerException
' Display basic error information
Response.Write("An error occurred in the application:<br>")
Response.Write(ex.Message & "<br>")
Response.Write("Stack trace:<br>")
Dim s As StringBuilder = New StringBuilder(ex.StackTrace)
Response.Write(s.Replace(" at ", " at<br> "))
Response.End()
' Clear the error
Server.ClearError()
End Sub
But it did not work...I tried to trap the event on the Page's onError
method too it did not work...could someone please help...

TALIA

Many Regards
Jack

Nov 18 '05 #3

P: n/a
I don't believe a time out is an exception which is why you aren't able to
catch it.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Jack Wright" <su***@volcanomail.com> wrote in message
news:8f**************************@posting.google.c om...
Not yet...wot do I do?

Please help...

TALIA

Many Regards
Jack

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message

news:<uF**************@tk2msftngp13.phx.gbl>...
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Jack Wright" <su***@volcanomail.com> wrote in message
news:8f**************************@posting.google.c om...
Dear All,
I have a web Application "http://localhost/Web/WebForm1.aspx" that
calls a WebService from
"http://localhost/webserviceapp/service1.asmx"...I have set the
executionTimeout to 10 secs in Web.Config where my WebService is
installed.
<httpRuntime executionTimeout="10" appRequestQueueLimit="2" />

When I call a method "TestPlan" which takes more than 10 secs my web
Page gets the following error:
Error: Client found response content type of 'text/html;
charset=utf-8', but expected 'text/xml'. The request failed with the
error message: --
Server Error in '/WebServiceApp' Application.
Exception Details: System.Web.HttpException: Request timed out.
I tried to trap the error on Application_Error function of Global.asax
of both my Web page and the WebService...
Sub Application_Error(ByVal sender As Object, _
ByVal e As EventArgs)
' Get the actual error that brought us here
Dim ex As Exception = _
Server.GetLastError.InnerException
' Display basic error information
Response.Write("An error occurred in the application:<br>")
Response.Write(ex.Message & "<br>")
Response.Write("Stack trace:<br>")
Dim s As StringBuilder = New StringBuilder(ex.StackTrace)
Response.Write(s.Replace(" at ", " at<br> "))
Response.End()
' Clear the error
Server.ClearError()
End Sub
But it did not work...I tried to trap the event on the Page's onError
method too it did not work...could someone please help...

TALIA

Many Regards
Jack

Nov 18 '05 #4

P: n/a
Can I trap this?
Error: Client found response content type of 'text/html;
charset=utf-8', but expected 'text/xml'
If I can then I show a neat message to the user...

Thanks & Regards
Jack

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message news:<uP*************@tk2msftngp13.phx.gbl>...
I don't believe a time out is an exception which is why you aren't able to
catch it.

Nov 18 '05 #5

P: n/a
You cannot trap errors by string description. You may have your webserver
sniff out the http error code and take appropriate action as a work around.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Jack Wright" <su***@volcanomail.com> wrote in message
news:8f**************************@posting.google.c om...
Can I trap this?
Error: Client found response content type of 'text/html;
charset=utf-8', but expected 'text/xml'
If I can then I show a neat message to the user...

Thanks & Regards
Jack

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message

news:<uP*************@tk2msftngp13.phx.gbl>...
I don't believe a time out is an exception which is why you aren't able to catch it.

Nov 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.