PUT and DELETE getting 404 in WCF REST service .ne

2019-06-28 02:20发布

问题:

I've added the wildcard application mapping for c:\windows\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll and unchecked the "verify that file exist" checkbox. This gives me GET and POST ability but not PUT and DELETE.

I have both prohibited and allowed WebDav under the web service extensions.

Application works like a champ when running in development environment. PUT and DELETE don't work when running app in IIS.

Any help is appreciated.

回答1:

Have you defined the extra verbs in the ISAPI extension that is linked to WCF?
To do this, open up IIS and edit the properties of the website. From their click on the Home Directory tab, and then the configuration button. In the mappings tab find the appropriate extensions, and double click it. In the new window you will find a field called "Limit To" which should have the HTTP Verbs you wish to use defined.



回答2:

Old Question but worth a potential solution:

Check you don't have http://www.iis.net/downloads/microsoft/urlscan installed, by default it disallows PUT and DELETE amongst other verbs.