【问题标题】:Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding找不到与具有绑定 BasicHttpBinding 的端点的方案 https 匹配的基地址
【发布时间】:2012-05-17 06:56:32
【问题描述】:

我正在尝试创建仅具有传输安全性的 WCF 服务,因此我不需要 SSL。

我在运行它时不断收到此错误消息:

Could not find a base address that matches scheme https for the endpoint with binding 
BasicHttpBinding.

我的 Web.config 文件如下所示:

<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>      
        <binding name="Binding1">
          <security mode="Transport">
            <transport clientCredentialType="Basic"></transport>
          </security>
        </binding>      
      </basicHttpBinding>

    </bindings>
    <services>
      <service behaviorConfiguration="ServiceBehavior" name="AutoSenderWCFService.AutoSenderService">        
        <endpoint binding="basicHttpBinding"  bindingConfiguration="Binding1"
          contract="AutoSenderWCFService.IService1" />        
      </service>
    </services>

    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior">
          <serviceCredentials>

            <userNameAuthentication userNamePasswordValidationMode="Custom"
              customUserNamePasswordValidatorType="AutoSenderWCFService.MyValidator, AutoSenderWCFService"/>

          </serviceCredentials>

          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="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="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>

【问题讨论】:

    标签: c# wcf web-services


    【解决方案1】:

    传输安全意味着使用 SSL 保护您的通道,因此您需要证书。

    如果您不想使用 SSL 但想通过通道传递用户名密码,那么您可以使用 ClearUsernameBinding 以明文形式通过通道发送用户名密码。

    注意:确保仅在您确信您的客户端和服务器通道是安全的(例如在提供安全性的防火墙之后)时才使用它。

    【讨论】:

      【解决方案2】:

      我在那里看不到任何地址 - 将地址添加到您的端点,应该没问题

      所以:

      <endpoint binding="basicHttpBinding" address="https://address" bindingConfiguration="Binding1" 
                contract="AutoSenderWCFService.IService1" />  
      

      【讨论】:

        【解决方案3】:

        就我而言,我试图在没有 ssl 的测试服务器上测试 wcf Web 服务设置。我将安全模式更改为无,它开始为我工作。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2023-03-31
          • 1970-01-01
          • 2021-06-02
          • 2012-04-06
          • 2020-06-02
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多