.net 4.0 - 405 (POST not allowed) HttpException when trying to apply HttpResponse.Filter -


we getting 405 error , following exception iis7 when attempting apply responsestreamfilter httpresponse.filter:

httpexception:  http verb post used access path '/app/thing.asmx/command' not allowed. 

we applying filter using httpmodule code this:

var rfs = new responsefilterstream(httpcontext.current.response.filter); rfs.transformstream +=     new func<system.io.memorystream, system.io.memorystream>(processstream); httpcontext.current.response.filter = rfs; log("response stream filter applied correctly."); 

all of code in our httpmodule works fine... it's wrapped in try-catch safe , isn't throwing exceptions, , diagnostic logging last line above working correctly.

but looks our processstream method in above code never being called. if apply filter httpresponse.filter @ all, iis throws 405 exception before our filter begins processing.

our code has worked before on several similar systems, suspect iis/machine configuration on specific server responsible. causing this?

the commonly reported cause 405 error in situation seems using url.rewrite. (the http verb post used access path '/test.html' not allowed) however, never using url.rewrite.

another commonly reported cause trailing slashes in request url. (http 405 on error on http post iis asp .net) mentioned above, url being requested not end slash.

the app pool is running .net 4.0 in classic pipeline (jquery ajax post receives 405 error (http verb post not allowed)), our code has run without issue on many other systems under classic app pool, there still have unique server's configuration. changing integrated pipeline breaks application our code filtering, that's not possible workaround anyway.

turns out, obscure iis bug:

http://support.microsoft.com/kb/980368

the extensionlessurl handler (*.) incorrectly getting involved request instead of webservicehandlerfactory (*.asmx) expected. workaround was:

  1. manually deleting extensionlessurl handler entries web application's handler mappings
  2. manually moving extensionlessurl handler entries under expect hit
  3. adding web.config entry under system.webserver/handlers remove extensionslessurl handler needed (we went option make sure got included app demployment)

we had burn microsoft support ticket on one, since there's no way have figured out in reasonable timeframe. helps else.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -