加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

.net – 使用basicHttpBinding时使HTTPS工作

发布时间:2020-12-16 03:37:21 所属栏目:asp.Net 来源:网络整理
导读:我正在使用WCF4并且无法通过https获得服务 我已经创建了一个wcf服务并部署到服务器,它在http上工作正常.一旦我将web.config端点地址更改为https,我就会收到错误消息 Service ‘NS.WebWCF.BusinessV1’ has zero application (non-infrastructure) endpoints.
我正在使用WCF4并且无法通过https获得服务

我已经创建了一个wcf服务并部署到服务器,它在http上工作正常.一旦我将web.config端点地址更改为https,我就会收到错误消息

Service ‘NS.WebWCF.BusinessV1’ has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application,or because no service element matching the service name could be found in the configuration file,or because no endpoints were defined in the service element.

我的web.config看起来像

<services>
  <service name="NS.WebWCF.Business_v1">
    <endpoint address="https://mydomain.com/business/v1/BusinessV1.svc" binding="basicHttpBinding" bindingConfiguration="" contract="NS.WebWCF.IBusinessV1" listenUri="/" isSystemEndpoint="true">
     </endpoint>
  </service>

我已将IIS设置为需要SSL.但是我得到了上面的错误.

要使https工作,我需要做什么?

解决方法

试试这个:

<system.serviceModel>
  <bindings >

    <webHttpBinding>
      <binding name="webBinding">
        <security mode="Transport">
        </security>
      </binding>
    </webHttpBinding>

  </bindings>

  <services>
    <service ...>
      <endpoint bindingConfiguration="webBinding" .../>
    </service>
  </services>

</system.serviceModel>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读