【发布时间】:2020-01-09 10:47:39
【问题描述】:
我正在尝试将传输安全层添加到我的 WCF 服务。但是按照所有说明操作后,我仍然收到错误“找不到与绑定 BasicHttpBinding 的端点的方案 https 匹配的基地址。注册的基地址方案是 [http]。”
已经在 IIS 管理器中完成了所有需要的配置,并在 web.config 中添加了需要的代码,但我仍然觉得我缺少一些东西
web.config:
<system.serviceModel>
<services>
<service name="MyNameSpace.MyService" behaviorConfiguration="secureBehavior">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="secureHttpBinding" contract="MyNameSpace.IMyService" />
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="secureHttpBinding">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="secureBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
【问题讨论】:
-
您是否在服务器上启用了 SSL?