WebDav troubles for restfull WCF web service

2020-04-06 15:43发布

问题:

I created a WCF restfull service in .NET 4 and I published it under IIS 7.5/windows 7 x86. The verbs GET and POST worked fine, but the DELETE and PUT gave an error:

Error: The remote server returned an error: (405) Method Not Allowed.

After googling (a lot), I've found out that the problem is caused by WebDav module which is installed (automatically? dunno) in IIS. The only approach that worked for me was the one found here.

However, removing the webdav module from the entire web site is somewhat too intrusive, in my opinion. Does anyone know another approach to inhibit the filtering action on verbs imposed by webdav, but only for a specific web application, not for the whole website?

Thank you.

EDIT I know about missing put and delete still leads to restful service - but I keep wanting to allow these verbs.

回答1:

You don't need to remove module for whole site. You can configure modules per application. Modules section is available in Management console per application.

You really have to remove WebDav for REST service's application because PUT and DELETE verbs were formerly defined for WebDav and are consumed by WebDav automatically.