Asp.net web服务元数据的配置在https上出现错误
我知道这里面有很多线索,但我不知道我做错了什么。使用以下配置,当我尝试通过https访问服务时,会出现以下错误: 找不到与绑定为WSHttpBinding的终结点的方案https匹配的基址。注册的基址方案为[http]` 这是my web.config的相关部分。谢谢Asp.net web服务元数据的配置在https上出现错误,asp.net,.net,wcf,Asp.net,.net,Wcf,我知道这里面有很多线索,但我不知道我做错了什么。使用以下配置,当我尝试通过https访问服务时,会出现以下错误: 找不到与绑定为WSHttpBinding的终结点的方案https匹配的基址。注册的基址方案为[http]` 这是my web.config的相关部分。谢谢 <system.serviceModel> <bindings> <wsHttpBinding> <binding name="sslBi
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="sslBindingConfig">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service name="MEA.SAWS.Service.SARuleService" behaviorConfiguration="ServiceBehavior">
<!-- Service Endpoints -->
<endpoint address=""
binding="wsHttpBinding"
bindingConfiguration="sslBindingConfig"
contract="MEA.SAWS.ServiceContract.ISARuleService">
</endpoint>
<endpoint address="mex"
binding="mexHttpsBinding"
bindingConfiguration=""
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpsGetEnabled="true"/>
<!-- 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="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
将服务端点上的绑定更改为
wsHttpsBinding
而不是wsHttpBinding
:
<endpoint address=""
binding="wsHttpsBinding"
bindingConfiguration="sslBindingConfig"
contract="MEA.SAWS.ServiceContract.ISARuleService">
如果这对将来的其他人有帮助的话,我就知道了。问题是负载平衡器后面的所有服务器都只绑定到https,而负载平衡器是SSL。因此,基本上,绑定必须始终完全匹配的WCF格言在这里并不适用。客户端调用必须配置为https,但服务器端点必须配置为http。我认为这不再是有效的绑定。