【发布时间】:2015-07-30 06:39:09
【问题描述】:
我有一个使用 http 连接到 Web 服务的 Windows 应用程序。我一直在网上阅读一些关于如何使用 https 进行连接的文章。我已将 IIS 设置为使用 https,但我无法让应用程序使用它。这不是 WCF 服务。
我在调用 Web 服务时收到的错误是
提供的 URI 方案“https”无效;预期的“http”。 参数名称:via
我已经读到我需要将安全模式添加到 app.config 但是当我这样做时它不会改变我的错误。
这是我的 app.config 摘录。
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="Service1SoapClient" openTimeout="00:11:00" sendTimeout="00:11:00"
maxReceivedMessageSize="9999999"/>
<binding>
<security mode="Transport"></security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://lenovo-pc/service1.asmx" binding="basicHttpBinding"
bindingConfiguration="Service1SoapClient" contract="BankService.Service1Soap"
name="Service1Soap" />
</client>
</system.serviceModel>
【问题讨论】: