找不到具有绑定 MetadataExchangeHttpBinding 的终结点的与方案 http 匹配的基址。注册的基址方案是 [https]
找不到具有绑定 MetadataExchangeHttpBinding 的终结点的与方案 http 匹配的基址。注册的基址方案是 [https]
扫一扫加作者微信
找不到具有绑定 MetadataExchangeHttpBinding 的终结点的与方案 http 匹配的基址。注册的基址方案是 [https]
“/”应用程序中的服务器错误。
找不到具有绑定 MetadataExchangeHttpBinding 的终结点的与方案 http 匹配的基址。注册的基址方案是 [https]。
说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.InvalidOperationException: 找不到具有绑定 MetadataExchangeHttpBinding 的终结点的与方案 http 匹配的基址。注册的基址方案是 [https]。
错误原因:
IMetadataExchange 接口没有匹配HTTPS协议的配置
解决方案:
检查web.config文件services接点
所有 binging="mexHttpBinding" 改为:binging="mexHttpsBinding"
XML Code:
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
//来源:C/S框架网 | www.csframework.com | QQ:23404761
//来源:C/S框架网 | www.csframework.com | QQ:23404761
XML Code:
<!--WCF服务配置,配置服务对应的接口-->
<services>
<service behaviorConfiguration="myBehavior" name="CSFrameworkV5.WCFContract.WCF_Class.CommonService">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="WSHttpBindings" contract="CSFrameworkV5.WCFContract.ICommonService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
</service>
</services>
//来源:C/S框架网 | www.csframework.com | QQ:23404761
<services>
<service behaviorConfiguration="myBehavior" name="CSFrameworkV5.WCFContract.WCF_Class.CommonService">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="WSHttpBindings" contract="CSFrameworkV5.WCFContract.ICommonService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
</service>
</services>
//来源:C/S框架网 | www.csframework.com | QQ:23404761
检查web.config文件behaviors接点,httpsGetEnabled="true"
XML Code:
<!--WCF服务配置 通用行为配置-->
<behaviors>
<serviceBehaviors>
<behavior name="myBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="200" maxConcurrentInstances="200"/>
</behavior>
</serviceBehaviors>
</behaviors>
//来源:C/S框架网 | www.csframework.com | QQ:23404761
<behaviors>
<serviceBehaviors>
<behavior name="myBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="200" maxConcurrentInstances="200"/>
</behavior>
</serviceBehaviors>
</behaviors>
//来源:C/S框架网 | www.csframework.com | QQ:23404761
另外,检查IIS高级设置,是否已启用的协议改为:http,https
扫一扫加作者微信
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网