最近在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服务或者
这里分享一下相关绑定安全设置,地址: