2010-07-26 57 views
4

在.NET 4 WCF的背景下,我嘗試使用新的AllowInsecureTransport屬性,這樣我可以用我的自定義身份驗證不使用SSL(在我們的開發環境中唯一的 - 我們使用SSL中生產)。WCF:如何使用AllowInsecureTransport

我綁定配置是這樣的:

<bindings> 
    <wsHttpBinding> 
    <binding name="CustomAuthentication"> 
     <security mode="TransportWithMessageCredential" allowInsecureTransport="true"> 
     <transport clientCredentialType="None" /> 
     <message clientCredentialType="UserName"/> 
     </security> 
    </binding> 
    </wsHttpBinding> 
</bindings> 

但是,我得到一個無法識別的屬性 'allowInsecureTransport'錯誤。 該屬性在this thread所描述的,並具有help on msdn

有人可以幫助我與我的WCF的配置選項,而無能的知識和指向我的方向是正確的?

我不希望如here那樣使用ClearUsernameBinding,但會在沒有其他內置選項的情況下使用。

回答

4

我相信這個元素只能用於通過自定義綁定......如果你看到的文檔,它的SecurityBindingElement,不是一個標準像wsHttpBinding綁定的一部分的一部分。您指出的線程確實有一個使用自定義綁定來啓用它的配置示例。