gpt4 book ai didi

.net - 使用 basicHttpBinding 时使 HTTPS 正常工作

转载 作者:行者123 更新时间:2023-12-02 17:51:36 26 4
gpt4 key购买 nike

我正在使用 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>

关于.net - 使用 basicHttpBinding 时使 HTTPS 正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6092483/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com