【问题标题】:VS 2010 VB.NET HTTPS SERVICE REFERENCEVS 2010 VB.NET HTTPS 服务参考
【发布时间】: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> 

【问题讨论】:

  • 您尝试过herehere 发布的建议解决方案吗?
  • 我相信我明白了。这是几件事。

标签: asp.net vb.net


【解决方案1】:

我想我明白了。我经历了一些事情,但最终得到了以下工作。

 <system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="Service1SoapClient" openTimeout="00:11:00" sendTimeout="00:11:00"
      maxReceivedMessageSize="9999999">
      <security mode="Transport">
        <transport clientCredentialType="None" proxyCredentialType="None"
          realm="" />
        <message clientCredentialType="Certificate" algorithmSuite="Default" />
      </security>
    </binding>
   </basicHttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="secureBehaviours">
      <serviceMetadata httpsGetEnabled="true"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
<client>
  <endpoint address="https://lenovo-pc/service1.asmx" binding="basicHttpBinding"
    bindingConfiguration="Service1SoapClient" contract="BankService.Service1Soap"
    name="Service1Soap" />
 </client>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-12-24
    • 2013-01-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多