2009-08-12 59 views
1

迎接。我意識到這可能被視爲this的重複問題,但我收到了一個不同的錯誤。可以通過SSL(使用https)將傳輸安全性設置爲無的WCF綁定?

我的IIS設置爲使用SSL。 我的服務設置相對簡單。只需一個簡單的登錄服務。

當我嘗試直接導航到主機我得到這個錯誤

服務不能被激活的SVC文件,因爲編譯過程中的異常。異常消息是:此服務的安全設置需要Windows身份驗證,但未啓用承載此服務的IIS應用程序。

我不想在訪問此特定服務時進行任何身份驗證。我應該不能使用HTTPS綁定傳輸消息信用和客戶端身份驗證設置爲無?

我有一個證書設置符合SSL,似乎很好。這就是現在這種認證方式。

<system.serviceModel> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="DefaultBehaviour"> 
     <serviceMetadata httpsGetEnabled="true" /> 
     <serviceCredentials> 
     <serviceCertificate findValue="xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx" 
      storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint" /> 
     </serviceCredentials> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<bindings> 
    <wsHttpBinding> 
    <binding name="wsBinding"> 
     <security mode="Transport"> 
     <message clientCredentialType="None" /> 
     </security> 
    </binding> 
    </wsHttpBinding> 
    <mexHttpsBinding> 
    <binding name="mex" /> 
    </mexHttpsBinding> 
</bindings> 
<services> 
    <service behaviorConfiguration="DefaultBehaviour" name="Web.Login.LoginService"> 
    <endpoint name="wsBinding" 
       address="https://staging.system.com/System/LoginService/LoginService.svc" 
       binding="wsHttpBinding" bindingConfiguration="wsBinding" 
       contract="Web.Login.IOLELoginService" /> 
    <endpoint address="mex" binding="mexHttpsBinding" bindingConfiguration="mex" name="mex" contract="IMetadataExchange" /> 
    </service> 
</services> 

回答

3

你應該能夠有一個 - 只有你沒有配置它的方式!

<security mode="Transport"> 
    <message clientCredentialType="None" /> 
    </security> 

如果你有交通運輸安全,您需要設置clientCredentialType<transport>子元素!

試試這個:

<security mode="Transport"> 
    <transport clientCredentialType="None" /> 
    </security> 

這應該有希望的工作(沒有安裝,現在對其進行測試)

馬克

+0

甜。當然。謝謝。這似乎是。當我現在導航到svc文件時,我沒有收到任何錯誤,但頁面只是空白。 – topwik 2009-08-12 21:07:46

+0

好的完美。我的配置一定還是搞砸了,但是。現在看起來不錯。非常感謝! – topwik 2009-08-12 21:22:49