提供的URI方案“http”无效;预期'https'

时间:2012-05-07 09:49:56

标签: .net wcf windows-services

我有一个win服务配置文件,如下所示

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

我收到以下错误。提供的URI方案“http”无效;预计'https'。 参数名称:via
我应该更改绑定或安全设置吗? 顺便禁用SSL证书。

3 个答案:

答案 0 :(得分:1)

您似乎已在安全设置中配置UserNameOverTransport - &gt;在WCF中,只允许使用HTTPS绑定,因为密码使用此设置以明文形式传输。

安全方面一个很好的功能,在开发时可能有点讨厌。

答案 1 :(得分:1)

同意Georg。如果您有正当理由发送不安全的用户/通行证,则可以通过ClearUsernameBinding在消息级别执行此操作:http://webservices20.blogspot.com/2008/11/introducing-wcf-clearusernamebinding.html

答案 2 :(得分:0)

我收到同样的错误,并使用set as start project用于.web项目,现在它运行正常。

相关问题