简体   繁体   中英

The provided URI scheme 'http' is invalid; expected 'https'

I have a win service config file as follows

 <system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="BasicHttpBinding_webservice" closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
      allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
      maxBufferSize="102400000" maxBufferPoolSize="102400000" maxReceivedMessageSize="102400000"
      messageEncoding="Mtom" textEncoding="utf-8" transferMode="Buffered"
      useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="102400000"
        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <security mode="TransportCredentialOnly">
        <transport clientCredentialType="Basic" proxyCredentialType="None"
          realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>
  </basicHttpBinding>
</bindings>
<client>
  <endpoint address="http://systemname/ProxyService/Service.svc"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_webservice"
    contract="ABC.webservice" name="BasicHttpBinding_webservice" />
</client>  

I am getting the following error. The provided URI scheme 'http' is invalid; expected 'https'. Parameter name: via
Should I change the binding or security settings? The SSL certificate is disabled by the way.

It looks like you have configure UserNameOverTransport in the security settings --> In WCF this is only allowed using HTTPS binding, as Passwords are transmitted in cleartext using this setting.

Security wise a good feature, can be a bit nasty while developing.

Agree with Georg. If you have a valid reason to send unsecured user/pass you could do that at the message level via ClearUsernameBinding: http://webservices20.blogspot.com/2008/11/introducing-wcf-clearusernamebinding.html

我得到了同样的错误并使用set as start project .web项目的set as start project项目,现在它工作正常。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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