VS 2010 VB.NET HTTPS服务引用 [英] VS 2010 VB.NET HTTPS SERVICE REFERENCE

查看:122
本文介绍了VS 2010 VB.NET HTTPS服务引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有使用http连接到Web服务的Windows应用程序。我一直在阅读有关如何使用HTTPS连接在网络上的几篇文章。我设置IIS使用https,但我不能让使用它的应用程序。这不是一个WCF服务。

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

所提供的URI方案的https是无效的;预计HTTP。
参数名称:通过

我已阅读,我需要把安全模式添加到的app.config,但是当我这样做,它不会改变我的错误。

这是我的app.config摘录。

 < system.serviceModel>
    <&绑定GT;
      <&basicHttpBinding的GT;
        <绑定名称=Service1SoapClientopenTimeout =〇时11分00秒的SendTimeout =〇时11分00秒
          maxReceivedMessageSize =9999999/>
        <结合>
          <安全模式=运输>< /安全>
        < /&结合GT;
      < / basicHttpBinding的>
         < /绑定>
    <客户端>
      <端点地址=HTTPS://lenovo-pc/service1.asmx绑定=basicHttpBinding的
        bindingConfiguration =Service1SoapClient合同=BankService.Service1Soap
        NAME =Service1Soap/>
      < /客户>
  < /system.serviceModel>


解决方案

我想我知道了。这是一个几件事我走过去,但结束了下面的工作。

 < system.serviceModel>
<&绑定GT;
  <&basicHttpBinding的GT;
    <绑定名称=Service1SoapClientopenTimeout =〇时11分00秒的SendTimeout =〇时11分00秒
      maxReceivedMessageSize =9999999>
      <安全模式=运输>
        <运输clientCredentialType =无proxyCredentialType =无
          境界=/>
        <消息clientCredentialType =证书algorithmSuite =默认/>
      < /安全>
    < /&结合GT;
   < / basicHttpBinding的>
< /绑定>
<&行为GT;
  < serviceBehaviors>
    <行为NAME =secureBehaviours>
      < serviceMetadata httpsGetEnabled =真/>
    < /行为>
  < / serviceBehaviors>
< /行为>
<客户端>
  <端点地址=HTTPS://lenovo-pc/service1.asmx绑定=basicHttpBinding的
    bindingConfiguration =Service1SoapClient合同=BankService.Service1Soap
    NAME =Service1Soap/>
 < /客户>

I have a windows application that connects to a web service using http. I have been reading a few articles on the web on how to connect using https. I've setup IIS to use the https but I can't get the application to use it. It's not a WCF service.

The error I receive when invoking the web service is

The provided URI scheme 'https' is invalid; expected '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.

This is my app.config excerpt.

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

这篇关于VS 2010 VB.NET HTTPS服务引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆