找不到与具有绑定BasicHttpBinding的终结点的方案https匹配的基地址.注册的基本地址方案是http

本文关键字:方案 注册 基地址 http 地址 https BasicHttpBinding 绑定 找不到 结点 | 更新日期: 2023-09-27 17:59:56

我根据下面的链接编写了一个SL+WCF用户名密码授权演示。但我无法摆脱它。

我的Web.config:

http://blogs.infosupport.com/silverlight-3-securing-your-wcf-service-with-a-custom-username-and-password-authentication-mechanism/

<?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <system.web>
            <compilation debug="true" targetFramework="4.0" />
        </system.web>
        <system.serviceModel>

      <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
      <services>
        <service name="Sample.Web.Service" behaviorConfiguration="ServiceBehavior" >
          <host>
             <baseAddresses>
                <add baseAddress="https://localhost"/>
             </baseAddresses>
          </host>
          <endpoint address="" binding="basicHttpBinding" bindingConfiguration="test" contract="Sample.Web.IService">
            <identity>
              <
    dns value="localhost"/>
                </identity>
              </endpoint>
              <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
            </service>
          </services>
          <bindings>
            <basicHttpBinding>
              <binding name="test">
                <security mode="TransportWithMessageCredential">
                  <message clientCredentialType="UserName"/>
                </security>
              </binding>
            </basicHttpBinding>
          </bindings>
          <behaviors>
            <serviceBehaviors>
              <behavior name="ServiceBehavior">
                <serviceMetadata />
                <serviceDebug includeExceptionDetailInFaults="false" />
                <serviceCredentials>
                   <userNameAuthentication userNamePasswordValidationMode="Custom"
                       customUserNamePasswordValidatorType="Sample.Web.MyValidator, Sample.Web"/>
                </serviceCredentials>
              </behavior>
            </serviceBehaviors>
          </behaviors>
        </system.serviceModel>
    </configuration>

希望有人能帮忙。提前感谢!。

找不到与具有绑定BasicHttpBinding的终结点的方案https匹配的基地址.注册的基本地址方案是http

您收到此异常是因为您尚未在计算机上配置IIS以支持承载此应用程序的网站的HTTPS。当您使用此指定的安全选项时,WCF需要安全HTTP连接。您需要在IIS上为有问题的网站映射服务证书。