簡體   English   中英

找不到與綁定BasicHttpBinding的端點的方案https匹配的基址

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

我正在嘗試僅使用傳輸安全性創建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>

傳輸安全意味着使用SSL保護您的頻道,因此您需要一個證書。

如果您不想使用SSL但想通過頻道傳遞用戶名密碼,那么您可以使用ClearUsernameBinding以明文形式在頻道上發送用戶名密碼。

注意:確保僅在您確信客戶端和服務器通道安全時才使用此功能,例如在提供安全性的防火牆后面。

我在那里看不到任何地址 - 為你的終端添加一個地址,應該沒問題

所以:

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

在我的情況下,我試圖在沒有ssl的測試服務器上測試wcf Web服務設置。 我將安全模式更改為none,它開始為我工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM