IIS 7.5、Web 服务和 HTTP 405 错误 [英] IIS 7.5, Web Service and HTTP 405 error

查看:35
本文介绍了IIS 7.5、Web 服务和 HTTP 405 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个托管在我的机器上的网络服务.我使用 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.

推荐答案

经过几个小时的挣扎,这是对我有帮助的最终解决方案(从 fiddler 测试):

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.

这篇关于IIS 7.5、Web 服务和 HTTP 405 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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