获取HTTPS使用basicHttpBinding的时候工作 [英] Getting HTTPS to work when using basicHttpBinding

查看:861
本文介绍了获取HTTPS使用basicHttpBinding的时候工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用WCF4和有麻烦得到一个服务一起通过HTTPS

I am using WCF4 and having troubles getting a service to work over https

我已创建一个WCF服务,并部署到服务器,它是工作确定了HTTP。当我改变的web.config端点地址是HTTPS我得到一个错误

I have create a wcf service and deployed to server and it is working ok over http. As soon as I change the web.config endpoint address to be https I get an error

服务NS.WebWCF.BusinessV1有零应用(非基础结构)终结点。这可能是因为没有配置文件找到您的应用程序,或者是因为没有服务元素相匹配的服务名称可以在配置文件中找到,或者因为没有终点的服务元素定义。

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看起来像

My web.config looks like

 <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。不过,我得到上述错误。

I have set my IIS to require SSL. However I get the above error.

什么我需要做的就是HTTPS工作?

What do I need to do to get https to work?

推荐答案

试试这个:

<system.serviceModel>
  <bindings >

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

  </bindings>

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

</system.serviceModel>

这篇关于获取HTTPS使用basicHttpBinding的时候工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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