473,320 Members | 2,094 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,320 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 2346
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.