HTTPS WCF 基本 HttpBindings 获取 HTTP 403
我在 IIS 7.5 下托管的 WCF 上有一个 HTTPS Web 服务器。我已将 SSL 设置设置为需要 SSL 并忽略客户端证书。
当我尝试在 Visual Studio 中添加 Web 引用时,出现以下错误。我该如何解决这个问题?
我可以看到它正在尝试使用 HTTP 而不是 HTTPS 来请求 ?disco
。我认为这就是问题所在,但我不知道如何解决这个问题。
URL https://testserver/service1.svc?wsdl 处的文档未被识别为已知的文档类型。
每种已知类型的错误消息可能会帮助您解决问题:
- 来自“DISCO 文档”的报告是“下载时出错”http://testserver/service1.svc?disco< /a>'.'.
- 请求失败,HTTP 状态为 403:禁止。
- 来自“WSDL 文档”的报告是“无法识别文档格式(内容类型为“text/html;charset=UTF-8”)。”。
- 来自“XML Schema”的报告是“无法识别文档格式(内容类型为“text/html;charset=UTF-8”)。”。
- 来自“https://testserver/service1.svc?wsdl”的报告是“文档格式不是已识别(内容类型为“text/html;charset=UTF-8”)。'.
I have an HTTPS webserver on WCF hosted under IIS 7.5. I have set the SSL settings to require SSL and ignore client certificates.
When I try to add the web reference in Visual Studio, I get the following error. How do I fix this problem?
I can see that it's trying to request ?disco
using HTTP instead of HTTPS. I think this is the problem, but I am not sure how to address this.
The document at the url https://testserver/service1.svc?wsdl was not recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from 'DISCO Document' is 'There was an error downloading 'http://testserver/service1.svc?disco'.'.
- The request failed with HTTP status 403: Forbidden.
- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.
- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.
- Report from 'https://testserver/service1.svc?wsdl' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于您可以通过 Web 浏览器获取 WSDL,因此在 IIS 中托管服务和配置站点绑定可能会出现问题。这是不久前论坛上的一个已知问题,请查看以下链接:
问题在使用托管WCF服务时
如何:修复 IIS 上的 WCF 主机名
祝你好运!
Since you're able to get the WSDL through your web browser, a possible issue might be with hosting the service in IIS and configuring site bindings. It was a known issue on the forums some time ago, check out these links:
Problem in consuming hosted WCF service
HOWTO: Fix WCF Host Name on IIS
Good luck!
我必须禁用需要 SSL 才能使其正常工作。我不知道当您提供的 WSDL URL 是 HTTPS 时,为什么 disco 会执行 HTTP。
I had to disable Require SSL to get it to work. I am not sure why disco goes to do an HTTP when the WSDL URL you provide is HTTPS.