WCF客户端调用服务器端错误:"服务器已拒绝客户端凭据"。

WCF客户端和服务器端不在同一台机器上时,客户端调用服务器端会报如下错误:"服务器已拒绝客户端凭据"。

解决办法:

1、右击ServiceHost项目的App.config文件>>编辑WCF配置>>绑定>>右击:新建绑定配置,Name设为BindingBehaviorConfiguration;安全性:Mode设为None。这样在

App.config文件中会生成如下代码:

<binding name="BindingBehaviorConfiguration">

  <security mode="None">

   <transport clientCredentialType="Windows" />

   <message clientCredentialType="Windows" />

  </security>

</binding>

2、在<endpoint binding="netTcpBinding" contract="WCF.ServiceLib.Binding.IHello" address="net.tcp://192.168.1.110:54321/Binding/Hello"/>

处增加 bindingConfiguration="BindingBehaviorConfiguration":

<endpoint binding="netTcpBinding" contract="WCF.ServiceLib.Binding.IHello" address="net.tcp://192.168.1.110:54321/Binding/Hello"  bindingConfiguration="BindingBehaviorConfiguration"/>

3、在Client项目App.config文件中作相同操作。

Windows xp不会有这样的问题。今天先发个解决方案,改天再好好总结。

posted on 2008-12-17 22:21  Sail  阅读(2266)  评论(2编辑  收藏  举报

最新资讯 最新游戏 最新网页游戏