asp.net.net-3.5jqueryiis-6asmx

AJAX call not starting IIS worker process?


First of all, I'm not a pro on IIS configuration topic.

I got a website written in VB.NET 3.5 Web Forms. I have a small web service, ASMX, running as a part of this website. One page on the website calls the web service with AJAX (jQuery $.ajax function, post). The server is running Windows 2003 and IIS 6.0. The website and the web service are sharing the same Application Pool.

In IIS Application Pool properties there is a setting "Idle Timeout" which says "Shutdown worker processes after being idle for N (time in minutes)". The problem is when the worker process shuts down after N minutes, it is not being started again on any of the AJAX calls from the page. What can I do in this kind of situation? I've only dealt with .NET MVC before in terms of AJAX, and I have never seen anything like this.

There are no errors in the logs. Here is what's being returned by the server through XmlHttpRequest:

Ready State: 4

Status: 500

Status Text: Internal Server Error

Xhr Message: undefined

Response Text: {"Message":"There was an error processing the request.", "StackTrace":"","ExceptionType":""}

I was told that setting the Shutdown value to a big number, like 24 hours, would fix this. I guess it would, but to me it doesn't seem like a proper solution.

Edit

This is the JavaScript $.ajax call. I'm not sure if this will make any difference.

  $.ajax({
    type: "POST",
    url: "MyWebService.asmx/GetRecordsExceedingMessage",
    data: '{}',
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function(result) {
      LMM.Operative_CheckError(result);  //display Records Exceeding Message as validation error
    },
    error: function(xhr, status) {
      LMM.Operative_DisplayClientErrors(xhr);
    }
  });

EDIT: I just remembered this little piece from Web.config of the website:

<webServices>
  <protocols>
    <remove name="HttpGet"/>
    <remove name="HttpPost"/>
    <remove name="HttpPostLocalhost"/>
    <remove name="Documentation"/>
    <remove name="AnyHttpSoap"/>
  </protocols>
</webServices>

Solution

  • Is the MyWebService.asmx/GetRecordsExceedingMessage actually a correct way of accessing your asmx? If you fetch that url manually, will it start the worker? It might also be that your handler only handles a certain content-type, hence your application/json won't trigger it.

    I'm guessing that your handler-mapping isn't working, therefor IIS errors out and never starts your app-pool. Try activating detailed errors for IIS, I know you can do that for IIS7 and onwards, not sure how to do that in IIS6, maybe this will help:

    In IIS control panel select web site, right click to properties, then select the the custom errors tab.

    Now select all the custom pages (Click top page, press shift and click bottom page) and click set as default. All pages to now show as being default.

    Stop and the re-start IIS and now you should now get detailed errors.