473,231 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

Web Service won't respond and recycling the App Pool doesn't help

Bob
I've got a .NET Framework V1.1 web service running on a Windows 2003 Server
that has 2 web methods that are called from a web application on the same
server.

One is a fire-and-forget method that executes a long running process that
results in a database being updated.
The other is a normal syncronous method that returns configuration
information to the caller.

They both log their errors to the application event log.

The first thing the fire-and-forget web service does is validate that the
user is allowed to execute the web method. If the user is not allowed, an
error is logged to the event log and the web method terminates. Next it
updates a database indicating that a certain operation is taking place. After
that, it goes about executing a series of complex and time-consuming SQL
queries, hence the reason it's a web method, and the last thing it does is
update a database to indicate that operation has completed.

The second method simply returns the HttpContext.Current.User.Identity.Name
and the version number from the currently executing assembly.

The symptoms are: calling the fire-and-forget method never executes, but
doesn't generate an error. This is evident because the database that
indicates the operation is taking place is never updated.

Calling the second method results in a long wait followed by the error:
System.Net.WebException: The underlying connection was closed: An unexpected
error occurred on a receive.

Does anyone have any ideas about:

1) How to get the web service to start responding without rebooting the
server.

2) Preventing the web service from getting into this state to begin with.

Thanks.
Nov 23 '05 #1
5 2343
Bob,

I suspect that even fire-and-forget methods are going to be subject to the
same timeouts as web pages. Long running processes are best taken out of the
web and placed into services. We use MSMQ to sequence the requests taken by
the web service and route them to a background service. We can then make all
the webmethods synchronous returning a response indicating whether the
request has been accepted. Completion of the request is then signaled via
e-mail. This also allows us to balance the workload as we can control the
number of simultaneous, heavy processes running on the server.

For your second problem, have you been able to step into the web service in
Debug? Is it actually reaching your code?

"Bob" wrote:
I've got a .NET Framework V1.1 web service running on a Windows 2003 Server
that has 2 web methods that are called from a web application on the same
server.

One is a fire-and-forget method that executes a long running process that
results in a database being updated.
The other is a normal syncronous method that returns configuration
information to the caller.

They both log their errors to the application event log.

The first thing the fire-and-forget web service does is validate that the
user is allowed to execute the web method. If the user is not allowed, an
error is logged to the event log and the web method terminates. Next it
updates a database indicating that a certain operation is taking place. After
that, it goes about executing a series of complex and time-consuming SQL
queries, hence the reason it's a web method, and the last thing it does is
update a database to indicate that operation has completed.

The second method simply returns the HttpContext.Current.User.Identity.Name
and the version number from the currently executing assembly.

The symptoms are: calling the fire-and-forget method never executes, but
doesn't generate an error. This is evident because the database that
indicates the operation is taking place is never updated.

Calling the second method results in a long wait followed by the error:
System.Net.WebException: The underlying connection was closed: An unexpected
error occurred on a receive.

Does anyone have any ideas about:

1) How to get the web service to start responding without rebooting the
server.

2) Preventing the web service from getting into this state to begin with.

Thanks.

Nov 23 '05 #2
Bob


"Paul Hasell" wrote:
Bob,

I suspect that even fire-and-forget methods are going to be subject to the
same timeouts as web pages. Long running processes are best taken out of the
web and placed into services. We use MSMQ to sequence the requests taken by
the web service and route them to a background service. We can then make all
the webmethods synchronous returning a response indicating whether the
request has been accepted. Completion of the request is then signaled via
e-mail. This also allows us to balance the workload as we can control the
number of simultaneous, heavy processes running on the server.

In the case of the fire-and-forget web service, we have taken care of all
the timeout issues such that all the timeouts are set to 4 times the normal
run times. In addition, when there is a timeout, an error will be logged. No
error is being logged and no database updates are happening. The very first
database update is NOT in a transaction, so even if there is an error later
on, the first update would be visible in the database, and it's not.
For your second problem, have you been able to step into the web service in
Debug? Is it actually reaching your code?


We aren't allowed to debug on the server that is having problems, so no I
can't step through the web service.

I'm going to put in some writes to the event log to attempt to trace the
code. I've been hesitant to do so because making changes to the code will
usually cause the, "You changed your code, so it must be your code" finger
pointing.

Thanks for your response.

Nov 23 '05 #3
Bob,

Is their nothing in the Application/System/Security logs around the times of
the calls? It might be worth considering WSE 2.0 (if you've not already
installed this) which can be used to record a trace of web service calls on
the server. This can then be switched on/off via the web.config file.

"Bob" wrote:


"Paul Hasell" wrote:
Bob,

I suspect that even fire-and-forget methods are going to be subject to the
same timeouts as web pages. Long running processes are best taken out of the
web and placed into services. We use MSMQ to sequence the requests taken by
the web service and route them to a background service. We can then make all
the webmethods synchronous returning a response indicating whether the
request has been accepted. Completion of the request is then signaled via
e-mail. This also allows us to balance the workload as we can control the
number of simultaneous, heavy processes running on the server.


In the case of the fire-and-forget web service, we have taken care of all
the timeout issues such that all the timeouts are set to 4 times the normal
run times. In addition, when there is a timeout, an error will be logged. No
error is being logged and no database updates are happening. The very first
database update is NOT in a transaction, so even if there is an error later
on, the first update would be visible in the database, and it's not.
For your second problem, have you been able to step into the web service in
Debug? Is it actually reaching your code?


We aren't allowed to debug on the server that is having problems, so no I
can't step through the web service.

I'm going to put in some writes to the event log to attempt to trace the
code. I've been hesitant to do so because making changes to the code will
usually cause the, "You changed your code, so it must be your code" finger
pointing.

Thanks for your response.


Nov 23 '05 #4
Bob
Paul,

There is absolutely nothing in the event logs. Things are complicated by the
fact that we have a content switch that load balances to multiple servers. We
are pretty sure that the web service is NOT being executed as I added code to
write to the application event log as soon as one of the web method is
invoked. Nothing showed up in any of the event logs. We recycled the
application pool to force the code to be recompiled and then turned on
FileMon from SysInternals and seached the log for references to the web
service being read by the .NET runtime to be compiled and executed and it
didn't show anything.

We then did the same on our development server as a sanity check and FileMon
showed all sorts of .NET activity when we called the web service.

Thanks for the tip about WSE 2.0. I'll mention it in the meeting this
morning. Unfortunately, our company has segregated duties to such an extent
that it takes a meeting with people from 4 different groups to get the big
picture as to what may have been changed on the web servers and network gear
in the past week.

"Paul Hasell" wrote:
Bob,

Is their nothing in the Application/System/Security logs around the times of
the calls? It might be worth considering WSE 2.0 (if you've not already
installed this) which can be used to record a trace of web service calls on
the server. This can then be switched on/off via the web.config file.


Nov 23 '05 #5
Bob,

Have you got any IIS logging turned on? This might help to confirm whether
requests are getting through to IIS for the ASMX. There's an IE plug-in we
use called HTTPWatch (from www.simtec.ltd.uk) that we find useful for seeing
what's going on from the browser end and responses that it's getting. If your
accessing from another client application then HTTP Analyzer (from
www.ieinspector.com) might help as it monitors any/all HTTP requests from the
client.

"Bob" wrote:
Paul,

There is absolutely nothing in the event logs. Things are complicated by the
fact that we have a content switch that load balances to multiple servers. We
are pretty sure that the web service is NOT being executed as I added code to
write to the application event log as soon as one of the web method is
invoked. Nothing showed up in any of the event logs. We recycled the
application pool to force the code to be recompiled and then turned on
FileMon from SysInternals and seached the log for references to the web
service being read by the .NET runtime to be compiled and executed and it
didn't show anything.

We then did the same on our development server as a sanity check and FileMon
showed all sorts of .NET activity when we called the web service.

Thanks for the tip about WSE 2.0. I'll mention it in the meeting this
morning. Unfortunately, our company has segregated duties to such an extent
that it takes a meeting with people from 4 different groups to get the big
picture as to what may have been changed on the web servers and network gear
in the past week.

"Paul Hasell" wrote:
Bob,

Is their nothing in the Application/System/Security logs around the times of
the calls? It might be worth considering WSE 2.0 (if you've not already
installed this) which can be used to record a trace of web service calls on
the server. This can then be switched on/off via the web.config file.

Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tim Werth | last post by:
I posted this to microsoft.public.dotnet.general then I saw posts about services on this newsgroup. So, sorry for the independent cross-posting. This might not be the best place to post this,...
2
by: Jeremy S. | last post by:
Just wondering if/how a sliding Cache expiration interacts with Application Pool Worker Process Recycling. Specifically, if I were to place some value into the Cache object with a sliding window...
1
by: RaggiHolm | last post by:
I am writing a service that I want to be able to display "debug" information on a desktop window. I have the following code that displays the form (when service is properly set up) and the service...
3
by: Bragadiru | last post by:
Hi, I can publish My Asp.NET 2.0 web service, through a WebSetup project, on a Windows XP Pro Sp2 and it works fine. When I'm trying to publish it on a Windows 2003 Server IIS 6 => when I can...
6
by: Wayne Smith | last post by:
Hi, We are having a few problems with ASP.Net pages hanging during load when an Application Pool is recycled. To test this we have setup the following ASP.net page which refreshes every 2...
3
by: Marlene A. Roman | last post by:
Hope everybody is doing OK. I have a webservice which I request via https://. I'm also using WSE to generate an authenticated token.
2
by: Morten Snedker | last post by:
I'm not sure if this is the right group, but: When the IIS performs a recycle on an given Application Pool, the website on this pool seems to loose references to third-party DLL-files in the...
4
by: Steven Blair | last post by:
I need to write a service and I am unsure which particular type I should be using: Key requirements: 1. Service must be able to run 24/7 2. Persist certain data items (logging to disk or DB...
0
by: madhusvuce | last post by:
Iíve developed a website using ASP.NET 2.0 & deployed it on IIS 6.0.Iím using Cookies to store user related information. The expiry of this cookie is set for Ď7í days. In IIS one new application pool...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.