提供的 uri 方案 https 无效;预期“http”在应用程序配置中

发布于 2025-01-14 09:26:13 字数 1662 浏览 1 评论 0原文

我有一个像下面这样的 url 的 wcf

https://localhost:44370/service.svc

我有一个使用上面的 wcf 的窗口服务

,在我的 app.config 中我配置了与下面相同的内容,

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpsBinding_IService" maxBufferPoolSize="2147483647"
                        maxReceivedMessageSize="2147483647" />
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="https://localhost:44370/service.svc" binding="basicHttpBinding"
          bindingConfiguration="BasicHttpsBinding_IService" contract="FileServer.IService"
          name="BasicHttpsBinding_IService" />
    </client>
</system.serviceModel>

但我收到以下错误:提供的 uri 方案 https 无效; 预期为“http”

当我将绑定类型更改为 https 时,

<system.serviceModel>
    <bindings>
        <basicHttpsBinding>
            <binding name="BasicHttpsBinding_IService" maxBufferPoolSize="2147483647"
                        maxReceivedMessageSize="2147483647" />
        </basicHttpsBinding>
    </bindings>
    <client>
        <endpoint address="https://localhost:44370/service.svc" binding="basicHttpsBinding"
          bindingConfiguration="BasicHttpsBinding_IService" contract="FileServer.IService"
          name="BasicHttpsBinding_IService" />
    </client>
</system.serviceModel>

,如下所示,然后我收到以下错误

配置绑定扩展“system.servicemodel/binding.basichttpsbinding”无法找到。验证此绑定扩展是否已在“system.servicemodel/binding.basichttpsbinding”中正确注册并且拼写正确。

我能做什么来解决这个问题?

I have a wcf with like below url

https://localhost:44370/service.svc

I have a window service which is using the above wcf

and in my app.config I configured the same like below

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpsBinding_IService" maxBufferPoolSize="2147483647"
                        maxReceivedMessageSize="2147483647" />
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="https://localhost:44370/service.svc" binding="basicHttpBinding"
          bindingConfiguration="BasicHttpsBinding_IService" contract="FileServer.IService"
          name="BasicHttpsBinding_IService" />
    </client>
</system.serviceModel>

but I am getting the following error the provided uri scheme https is invalid; expected 'http'

when I changed my binding type into https like below

<system.serviceModel>
    <bindings>
        <basicHttpsBinding>
            <binding name="BasicHttpsBinding_IService" maxBufferPoolSize="2147483647"
                        maxReceivedMessageSize="2147483647" />
        </basicHttpsBinding>
    </bindings>
    <client>
        <endpoint address="https://localhost:44370/service.svc" binding="basicHttpsBinding"
          bindingConfiguration="BasicHttpsBinding_IService" contract="FileServer.IService"
          name="BasicHttpsBinding_IService" />
    </client>
</system.serviceModel>

then I am getting the below error

configuration binding extension 'system.servicemodel/binding.basichttpsbinding' could not be found. verify that this binding extension is properly registered in 'system.servicemodel/binding.basichttpsbinding' and that it is spelled correctly.

what can I do to solve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

临风闻羌笛 2025-01-21 09:26:13

您正在尝试将 HTTPS 地址与 HTTP 绑定一起使用,请将绑定类型更改为“basicHttpsBinding”。

You are trying to use a HTTPS address with a HTTP binding, change the binding type to 'basicHttpsBinding'.

旧话新听 2025-01-21 09:26:13

但我收到以下错误,提供的 uri 方案 https 是
无效的;预期“http”

添加安全模式,此更改将允许您使用 https 而不是 http。

 <basicHttpBinding>
    <binding name="BasicHttpsBinding_IService" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
      <security mode="Transport"> 
      </security> 
    </binding> 
 </basicHttpBinding>

but I am getting the following error the provided uri scheme https is
invalid; expected 'http'

You try adding security mode to the binding, this change will allow you to use https instead of http.

 <basicHttpBinding>
    <binding name="BasicHttpsBinding_IService" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
      <security mode="Transport"> 
      </security> 
    </binding> 
 </basicHttpBinding>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文