我已经浏览了几个建议解决这个问题的网站,但我仍然无法摆脱它。
我的网络配置:
<bindings>
<webHttpBinding>
<binding name="SecureBasicRest">
<security mode="Transport" />
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="svcBehavior">
<serviceMetadata httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="svcEndpoint">
<webHttp helpEnabled="true"/>
<enableWebScript/>
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="SvcContract.Authenticate" behaviorConfiguration="svcBehavior">
<endpoint binding="webHttpBinding" bindingConfiguration="SecureBasicRest"
behaviorConfiguration="svcEndpoint" name="webHttp"
contract="SvcContract.Authenticate" />
</service>
</services>
希望有人能提供帮助。提前致谢!。
编辑
我必须用
来完成这项工作
https://localhost:6188/Authenticate/Login?username=user&password=pass&ip=127.0.0.1
最佳答案
改变
<serviceMetadata httpsGetEnabled="true"/>
到
<serviceMetadata httpsGetEnabled="false"/>
您告诉 WCF 使用 https 作为元数据端点,我看到您在 http 上公开您的服务,然后您在标题中收到错误。
您还必须设置 <security mode="None" />
如果您想按照 URL 的建议使用 HTTP。
关于c# - 找不到与具有绑定(bind) WebHttpBinding 的终结点的方案 https 匹配的基址。注册的基址方案是 [http],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9817718/