未处理的通信故障是间歇性发生的 [英] Unhandled Communication Fault occurred happens intermittently
问题描述
我有一些PSI代码,我作为控制台应用程序运行,以更新一些自定义字段值。第一个PSI呼叫是ReadCustomFields(),但这是无关紧要的。
I have some PSI code that I run as a console application to update some custom field values. The first PSI call is to ReadCustomFields(), but that is irrelevant.
我发现大约一半时间,此呼叫出错: 发生未处理的通信故障。另一半它按预期工作。
I am finding that about half the time, this call gets the error: Unhandled Communication Fault occurred. The other half it works as expected.
我无法弄清楚它为什么会发生,但我发现用IE登录到我用PSI代码连接的PWA实例,解决它一段时间。然后它再次停止工作。我使用与将
传递给WCF客户端相同的凭据登录IE。这是我用来将凭据传递给WCF客户端的代码:
I can't figure out why it happens, but I have found that logging on with IE to the PWA instance I am connecting to with the PSI code, resolves it for a period of time. Then it stops working again. I log in with IE using the same credentials as I pass in to the WCF Client. Here's the code I use to pass in credentials to the WCF Client:
customFieldsClient.ClientCredentials.Windows.ClientCredential = new NetworkCredential(用户名,密码,域名);
customFieldsClient.ClientCredentials.Windows.ClientCredential = new NetworkCredential(username, password, domain);
我还设置了我的basicHttpConf绑定ClientCredentialType,如下所示:
I also set my basicHttpConf binding ClientCredentialType like this:
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
有没有人否则在独立的控制台应用程序上有这个问题?
Does anyone else have this problem on a standalone console application?
Carlos
推荐答案
微软的任何人都想要对此发表评论?
Anybody from Microsoft want to comment on this, please?
Carlos
这篇关于未处理的通信故障是间歇性发生的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!