简体   繁体   English

VS 2010 VB.NET HTTPS服务参考

[英]VS 2010 VB.NET HTTPS SERVICE REFERENCE

I have a windows application that connects to a web service using http. 我有一个Windows应用程序,该应用程序使用http连接到Web服务。 I have been reading a few articles on the web on how to connect using https. 我已经在网络上阅读了几篇有关如何使用https连接的文章。 I've setup IIS to use the https but I can't get the application to use it. 我已将IIS设置为使用https,但无法使应用程序使用它。 It's not a WCF service. 这不是WCF服务。

The error I receive when invoking the web service is 调用Web服务时收到的错误是

The provided URI scheme 'https' is invalid; 提供的URI方案“ https”无效; expected 'http'. 预期的“ http”。 Parameter name: via 参数名称:通过

I have read that I need to add the security mode to the app.config but when I do that it doesn't change my error. 我已经读到我需要将安全模式添加到app.config中,但是当我这样做时,它不会更改我的错误。

This is my app.config excerpt. 这是我的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> 

I think I got it. 我想我明白了。 It was a few things I went over, but ended up with the below working. 我经过了几件事,但最终完成了以下工作。

 <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