IIS 7.5,Web服务和HTTP 405错误

问题描述:

我有我的机器上托管的Web服务。我使用的是Windows 7和IIS 7.5。

I have a web service which I host on my machine. I use Windows 7 and IIS 7.5.

问题:当客户端尝试使用的Web服务,他/她得到一个HTTP 405错误

Problem: When the client tries to consume the web service, he/she gets a HTTP 405 error.

在IIS的日志文件,我可以看到,这是拒绝了,因为POST谓词是不允许的。

In the log file of IIS, I can see that this is refused because POST verb is not allowed.

:我怎样​​才能让POST谓词这些请求结果
我一定要添加WSDL文件的映射?如果我这样做,我怎么有配置这种映射?我已经检查,并在现有的映射我什么都没有了WSDL扩展。

Question: How can I allow POST verb for those requests?
Do I have to add mapping of the WSDL file? And if I do, how do I have to configure this mapping? I have checked, and in existing mappings I have nothing for WSDL extension.

有可能还有一点要在IIS设置为允许这些请求?

Is there maybe another thing to setup on IIS to allow those requests?

Web服务使用内置的 WCF

Web service is built using WCF.

在挣扎几个小时,这是最终的解决方案,帮助我(从小提琴手测试):

After hours of struggling, this is final solution that helped me (tested from fiddler):


  1. 在IIS 7.5 - > YourWebsite - >处理程序映射

  2. 选择添加模块映射选项,在面板的右侧

  3. 在请求路径字段中输入*的.wsdl

  4. 在模块栏中输入ProtocolSupportModule

  5. 单击请求限制,进入动词标签

  6. 输入POST谓词

  7. 保存更改

结束瞧,小提琴手不再与405,但与快乐200的答案。

End voila, fiddler no longer answers with 405 but with happy 200.