views:

39

answers:

1

We have a web.config in a physical subdirectory of a virtual directory that's under an application in an IIS site. Something like this:

  • Site
    • App
      • Web.config
      • Virtual Dir
        • Subdir
          • Web.config

In the Web.config we put this configuration in system.web:

<webServices>
  <protocols>
    <add name="HttpPost" />
    <add name="HttpGet" />
  </protocols>
</webServices>

We enable both protocols for an ASMX in that subdirectory.

It all works fine for a while and after that it just stops and those protocols just stop working. We restart IIS and it starts working again.

To fix this, we have used a workaround to add that configuration to the application Web.config and then it just works fine. But we would like to avoid changing the application Web.config and instead make the subdirectory Web.config work.

Any ideas why ASP.Net would just stop considering the subdirectory Web.config after a while?

We're hosting on Windows Server 2003, IIS 6, ASP.Net 2.0.

HTTP POST requests to the ASMX stop working. The error we're getting is System.InvalidOperationException with this message:

Request format is unrecognized for URL unexpectedly ending in '/blah'.

The stack trace is:

at System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)
at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
A: 

It's unlikely that get and post are really being ignored intermittently.

What is your ASMX doing? If you're allocating and not freeing a resource - like a connection to another service or WCF object - or entering a long-running task, IIS can stop responding to requests when those resources are exhausted. That would explain with restarting IIS fixes the problem.

Are you getting no response at all, an error 500, or what? Anything in the event log?

David Lively
The service is fast and does not hold any resources.
Dimitrije Jankovic