的WebDav烦恼的REST风格的WCF Web服务 [英] WebDav troubles for restfull WCF web service

查看:129
本文介绍了的WebDav烦恼的REST风格的WCF Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在创建.NET 4中一个WCF REST风格的服务,我出版了它的IIS 7.5 / Windows 7的86下。动词GET和POST精细的工作,但DELETE和PUT给了一个错误:

 错误:远程服务器返回错误:(405)不允许的方法。
 

谷歌搜索(很多)之后,我发现,这个问题是由它在IIS(自动?说不上来)安装的WebDav模块。这工作对我来说,唯一的办法是一个发现的here.

不过,从整个网站删除WebDAV模块是有点太冒昧,在我看来。有谁知道另一种方法来抑制由WebDAV的动词实行的过滤作用,但只适用于特定的Web应用程序,而不是整个网站?

感谢你。

修改 我知道失踪put和delete仍然会导致RESTful服务 - 但我不断想要让这些动词。

解决方案

您不必删除模块,用于整个网站。您可以为每一个应用模块。模块部分是在每个应用程序的管理控制台中可用。

您真的要删除的WebDav为REST服务的应用程序,因为PUT和DELETE动词是以前定义的WebDAV和通过的WebDav自动消耗。

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.

解决方案

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.

这篇关于的WebDav烦恼的REST风格的WCF Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆