My webservice quits responding...

Last post 07-21-2009 10:30 AM by raxitr. 7 replies.

Sort Posts:

  • My webservice quits responding...

    07-02-2009, 4:42 PM
    • Member
      point Member
    • BenHines
    • Member since 07-02-2009, 8:30 PM
    • Posts 8

    Hi,

    I'm really stuck on this one.  I have a web page that uses an AJAX web service that I wrote.  Based on a user clicking on a button, a call is made to my web service method and data is returned.  This works fine for a (seemingly random) number of calls to the method.  Then the web method quits responding.  My web service writes to a log file.  So, I put a log statement at the beginning of the web method in the code-behind file.  I see the message in the log until the service becomes unresponsive, which means that the web method isn't getting called.  I have no idea why this is happening.  I can't find any indication of an error or anything... not event in the IIS log.

    I thought it had something to do with using UpdatePanels on my web page.  The UpdatePanels seem to aggravate the problem, but don't seem to be the cause.  It seems like there is some limit to the amount of data or number of calls my page is allowed to make.  I'm really, really stumped on this one. 

    I've done some looking around various forums and have seen evidence of the same problem, but that had something to do with .NET framework 1.1.  I'm using .NET framework 3.5 (i think) and IIS 5.1.  Here's another strange thing...  If I run the same web app using the Visual Studio development web server, I don't see the bug (or at least it doesn't happen within a low number calls to the service).

    Any help would be greatly appreciated!

    Thanks,

    Ben

     

  • Re: My webservice quits responding...

    07-03-2009, 12:06 AM
    • Member
      180 point Member
    • Mike426
    • Member since 06-26-2009, 8:56 PM
    • Posts 35

     Since your web service performs some logging, can you have it log the local process id (i.e. the w3wp.exe or aspnet_wp.exe process hosting the web service)?  Check if it's the same process id every time, or if it changes as worker processes are recycled.  Basically, we just want to see if the IIS worker process getting recycled has anything to do with your web service seemingly not getting called.  

    If you launch your web page that has the button on it in a new browser window after the web service seems to stop responding, can you then get a response from your web service from the page in the new browser? 

    mike aht cognitier doht com
    http://www.cognitier.com
  • Re: My webservice quits responding...

    07-03-2009, 10:35 AM
    • Member
      point Member
    • BenHines
    • Member since 07-02-2009, 8:30 PM
    • Posts 8

    Hi Mike,

    I added some logging to output the process name and ID on every call to my web service.  I did the following experiment:

    - Fire up my web page

    - Continually press the button that causes the call to my web service until it becomes unresponsive

    - Leaving the old browser up, open a new browser and go to the same page

    - Press the button on that page until it becomes unresponsive

    The process name (aspnet_wp) and id (2920) remained constant through the entire experiment.  I'm also logging when a session starts and ends.  So, I was able to see both sessions startup.  After the first browser became unresponsive (at least the web service did), the button (and hence the web service call) worked fine in the second browser.  One thing I noticed was that the service calls became unresponsive in the second browser much faster than in the first one. 

    As a quick experiment, I decided to put some javascript alert messages in my client-side javascript button handler just to verify that the javascript is getting called (and hence the web service call is being attempted) and this is definitely the case.  The client-side javascript is always called.

    Let me know if this gives you any clues.  I know it doesn't give me any.

  • Re: My webservice quits responding...

    07-08-2009, 11:25 AM
    Answer
    • Member
      180 point Member
    • Mike426
    • Member since 06-26-2009, 8:56 PM
    • Posts 35

     If the web service responds when you open a new browser window, then the problem appears to be specific to the session of the web page.  I'm guessing it may not have anything to do with your web service.  It's good that you can reproduce the problem when you want to. 

    Can you post the code that does the web service call?  Also, can you confirm that all of the code behind your button click fires except the call to the web service?  You might just need to make sure you're cleaning everything up in between web service calls.  You could try putting the call to the web service in a separate class that implements IDisposable.  When you want to make the web service call, get a new instance of the class you just created, make the web service call in a class method, pass the results back from your class method to the code behind the button click, then dispose of your class instance.

    mike aht cognitier doht com
    http://www.cognitier.com
  • Re: My webservice quits responding...

    07-16-2009, 2:35 PM
    • Member
      point Member
    • BenHines
    • Member since 07-02-2009, 8:30 PM
    • Posts 8

    Hi,

    I'm still stuck on this one.  One thing I don't understand is that this problem only happens in IIS and never in the development web server.  Any clues on what the difference may be?

    -Ben

  • Re: My webservice quits responding...

    07-17-2009, 2:26 PM
    • Member
      point Member
    • BenHines
    • Member since 07-02-2009, 8:30 PM
    • Posts 8

    OK.  Here's some additional information... I decided to take a look at the IIS log to see if I could get a hint and what I'm seeing is that once the problem starts (i.e. unresponsive web service) IIS is simply not receiving requests.  In my test environment, I'm only dealing with a single client for my web site.  So, it's pretty easy to identify that requests are not getting through.  It looks like this may not be due to my web service, but because GETs and POSTs are not getting to the server. 

    Any idea on how I might debug what is happening?

  • Re: My webservice quits responding...

    07-20-2009, 9:38 AM
    • Member
      180 point Member
    • Mike426
    • Member since 06-26-2009, 8:56 PM
    • Posts 35

     Can you post some code for the web page that calls your web service?  It looks like the problem is confined to the user session for the interactive web page - like you mentioned, it may not have anything to do with your web service.  In IIS, have you configured your application pool for multiple worker processes, or is it just set to one?

    mike aht cognitier doht com
    http://www.cognitier.com
  • Re: My webservice quits responding...

    07-21-2009, 10:30 AM
    • Member
      307 point Member
    • raxitr
    • Member since 04-20-2009, 12:57 AM
    • Posts 63

    I would suggest using fiddler to intercept http request being made  http://www.fiddler2.com/fiddler2/ 

    Hopefully by looking at the raw http requests you may figure out whats going wrong..!!!


    - Raxit

Page 1 of 1 (8 items)