我在配置文件中为wsHttpBinding和传输安全性完成了以下配置。元数据交换,基地址和绑定全部都是为Https设置的,但仍然存在这个问题。
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WsHttpEndpointBinding">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="WCFWindowsBasicHttpBinding.Service1Behavior" name="WCFWindowsBasicHttpBinding.Service1">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="WsHttpEndpointBinding" name="WsHttpEndpoint" contract="WCFWindowsBasicHttpBinding.IService1">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="Mex" binding="mexHttpsBinding" contract="IMex"></endpoint>
<host>
<baseAddresses>
<add baseAddress="https://localhost/Service1.svc"/>
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WCFWindowsBasicHttpBinding.Service1Behavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="false" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
答案 0 :(得分:1)
您是否在IIS上托管该服务?如果是这样,请确保您正在部署的WebSite在IIS中定义了SSL绑定。