HTTPS WCF 基本 HttpBindings 获取 HTTP 403

发布于 2024-12-07 12:41:31 字数 900 浏览 0 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

堇年纸鸢 2024-12-14 12:41:31

由于您可以通过 Web 浏览器获取 WSDL,因此在 IIS 中托管服务和配置站点绑定可能会出现问题。这是不久前论坛上的一个已知问题,请查看以下链接:

祝你好运!

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:

Good luck!

天邊彩虹 2024-12-14 12:41:31

我必须禁用需要 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文