获取HTTPS使用basicHttpBinding的时候工作时候、工作、HTTPS、basicHttpBinding

由网友(梦醒了一个人ˇ)分享简介:我使用WCF4和有麻烦得到一个服务一起通过HTTPS I am using WCF4 and having troubles getting a service to work over https我已创建一个WCF服务,并部署到服务器,它是工作确定了HTTP。当我改变的web.config端点地址是HTTPS我得...

我使用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>
阅读全文

相关推荐

最新文章