wcf服务器拒绝了客户端凭据

时间:2014-01-09 08:39:12

标签: c# wcf

我正在尝试连接到wcf服务器。我的代码在同一台计算机上的服务器和客户端都有效。但是,当客户端设置在不同的计算机上时,它无法正常工作。 我找到了一些没有帮助的答案。 我得到的问题是:wcf服务器拒绝客户端凭据

以下是服务器配置的一部分:

     <security mode="Transport">
           <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign"/>
           <message clientCredentialType="Windows"/>
         </security>

客户端配置:

 <security mode="Transport">
              <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
              <message clientCredentialType="Windows" />
            </security>

客户代码:

  _wcfClient = new wcfServiceClient(context, new NetTcpBinding(SecurityMode.Transport),
                   new EndpointAddress(@"net.tcp://" + host +
                                @":7919/wcfControl/name/"));

    _wcfClient .Open();

我尝试将服务器安全性更改为“无”,但服务器无法运行。 唯一的解决方案是帮助是在客户端插入服务器Windows用户名和密码。但我想找到一个更好的解决方案。

感谢您的帮助

0 个答案:

没有答案
相关问题