You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WCF调用报错:提供的URI方案'https'无效,预期为'http',如何解决?

报错原因
  • 你使用的WCF basicHttpBinding 绑定默认采用HTTP明文传输模式,仅支持http前缀的服务地址,但你配置的endpoint地址用了https前缀,绑定的传输模式和地址协议不匹配,因此触发校验报错。
解决方法

可根据实际场景二选一处理:

场景1:确认服务端支持HTTPS,需要使用HTTPS调用

修改绑定配置,新增security节点,将传输模式设置为Transport开启HTTPS支持,修改后的配置如下:

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="Integration">
                <!-- 新增以下配置开启HTTPS支持 -->
                <security mode="Transport">
                    <transport clientCredentialType="None" />
                </security>
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="https://test/WcfService/Integration.svc"
        binding="basicHttpBinding" bindingConfiguration="Integration"
        contract="IntegrationService.Integration" name="Integration" />
    </client>
</system.serviceModel>

如果服务端要求客户端身份校验,可根据实际需求调整clientCredentialType的取值,可选值包括Windows、Basic、Certificate等。

场景2:服务端仅支持HTTP,地址填写错误

直接将endpoint的address属性中的https修改为http即可。


内容的提问来源于stack exchange,提问作者caglarboran

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.10 18:00:02