繁体   English   中英

VS 2010 VB.NET HTTPS服务参考

[英]VS 2010 VB.NET HTTPS SERVICE REFERENCE

我有一个Windows应用程序,该应用程序使用http连接到Web服务。 我已经在网络上阅读了几篇有关如何使用https连接的文章。 我已将IIS设置为使用https,但无法使应用程序使用它。 这不是WCF服务。

调用Web服务时收到的错误是

提供的URI方案“ https”无效; 预期的“ http”。 参数名称:通过

我已经读到我需要将安全模式添加到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> 

我想我明白了。 我经过了几件事,但最终完成了以下工作。

 <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>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM