最近在crm項目中加入了wcf服務層,以便於製作對外的客戶資料查詢以及呼叫中心的數據交換,主要內容如下:
1. Client在引用或者更新wcf的時候需要host中的配置打開mex元數據,實際發佈後需要進行關閉
2. 對於.netTcpBinding來說效率相對較快,但是不具備交互性
3. 對於wcf和非wcf進行通信的時候適用傳輸安全即可,對於netTcpBinding實例如下:
<bindings>
<netTcpBinding>
<binding name="netTcpBindingConfigration">
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign"/>
</security>
</binding>
</netTcpBinding>
</bindings>
4. 使用nettcpbinding在客戶端需要進行用戶名和密碼驗證
client.ClientCredentials.Windows.ClientCredential.UserName = "xxxx";
client.ClientCredentials.Windows.ClientCredential.Password = "xxxx";
宿主可以使用創建一個windows服務或者
這裏分享一下相關綁定安全設置,地址: