2012-05-17 119 views
4

我想創建一個只有傳輸安全的WCF服務,所以我不需要SSL。無法找到與綁定的端點匹配scheme https的基地址BasicHttpBinding

我一直歌廳此錯誤消息當我運行它:

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> 

回答

6

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

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

注意:請確保僅在確信客戶端和服務器通道像提供安全保護的防火牆後面一樣安全時使用此端口。

1

我不能在那裏看到任何地址 - 添加一個地址你的終點,應該是確定

這樣:

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

在我的情況下,我試圖在沒有ssl的測試服務器上測試wcf web服務安裝。我將安全模式更改爲無,並開始爲我工作。

相關問題