具有基本身份验证的基于WCF SSL Rest的web服务

具有基本身份验证的基于WCF SSL Rest的web服务,wcf,rest,ssl,basic-authentication,webhttpbinding,Wcf,Rest,Ssl,Basic Authentication,Webhttpbinding,我使用SSL部署了一个简单的基于WCF REST的服务(当然是开发)。我试图让它与基本的认证工作,但相当坦率地说,我与它一无所获 IIS 6.0 基于REST的-使用webHttpBinding 下面是我的web.config的外观。。。只是相关部分: <system.serviceModel> <services> <service behaviorConfiguration="ThisTestService.MyTestServiceBe

我使用SSL部署了一个简单的基于WCF REST的服务(当然是开发)。我试图让它与基本的认证工作,但相当坦率地说,我与它一无所获

IIS 6.0 基于REST的-使用webHttpBinding

下面是我的web.config的外观。。。只是相关部分:

  <system.serviceModel>
    <services>
      <service behaviorConfiguration="ThisTestService.MyTestServiceBehavior"
        name="ThisTestService.MyTestService">
        <endpoint address="" binding="webHttpBinding" bindingConfiguration="Secure" behaviorConfiguration="WebBehavior" contract="ThisTestService.IMyTestService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpsBinding" bindingConfiguration="Secure" contract="IMetadataExchange"></endpoint>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ThisTestService.MyTestServiceBehavior">
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="WebBehavior">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <bindings>
      <webHttpBinding>
        <binding name="Secure">
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Basic"/>
          </security>
        </binding>
      </webHttpBinding>
    </bindings>
  </system.serviceModel>

我已在IIS中关闭WCF服务虚拟目录上的匿名身份验证,并已打开基本身份验证

当我尝试访问它时,比如说使用,我无法访问它。它给出了“无法找到与绑定WebHttpBinding的端点的方案http匹配的基址。注册的基址方案为[https]”

我在谷歌上搜索了很多,但到目前为止,我所有试图理解和解决这个问题的努力都白费了。如果我使用匿名身份验证,那么我没有问题,但是我需要使用基本身份验证


非常感谢您的帮助。谢谢。

您需要为承载服务的虚拟目录打开https。(如本文最后一段所述:)

在IIS管理器中,您是否编辑了网站的绑定以使https可用?您好。。。您是指使用adsutils.vbs脚本吗?请参阅我的文章“”。