WebDav troubles for restfull WCF web service

走远了吗. 提交于 2019-12-01 16:21:02

问题


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.



来源:https://stackoverflow.com/questions/3745015/webdav-troubles-for-restfull-wcf-web-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!