如何配置WCF服务以在没有HTTP绑定的情况下通过HTTPS工作? [英] How to configure WCF services to work through HTTPS without HTTP binding?

查看:217
本文介绍了如何配置WCF服务以在没有HTTP绑定的情况下通过HTTPS工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将WCF服务配置为使用SSL,但仅当IIS网站中存在HTTP绑定时,它才有效。当HTTP绑定不存在且仅存在HTTPS绑定时,我收到以下错误:

I have configured my WCF services to work with SSL but it works ONLY if the HTTP binding exists in the IIS Web Site. When the HTTP binding not exists and exists only HTTPS binding I get the following error:



的HttpGetEnabled属性设置ServiceMetadataBehavior到真
和HttpGetUrl属性是
相对地址,但是没有http
基地址。提供http
基地址或将HttpGetUrl设置为
绝对地址。

The HttpGetEnabled property of ServiceMetadataBehavior is set to true and the HttpGetUrl property is a relative address, but there is no http base address. Either supply an http base address or set HttpGetUrl to an absolute address.

如何解决此问题问题?

谢谢。

推荐答案

以这种方式修改配置:

Modify your configuration this way:

<behaviors>
  <serviceBehaviors>
    <behavior> <!-- behavior can have name (must have name in WCF 3.x) -->
      <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

这篇关于如何配置WCF服务以在没有HTTP绑定的情况下通过HTTPS工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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