2012-07-17 28 views
0

我开发一个应用程序的安全WCF使用中的信息模式:安全协议无法验证传入消息?

  <security mode="Message">      
<message clientCredentialType="UserName" negotiateServiceCredential="true"/> 
</security> 

它的运行本地机器上很好,但是当我运行它以外的PC时,notifice错误:

The security protocol cannot verify the incoming message

使用跟踪我见:

The security timestamp is invalid because its creation time ('2012-07-17T21:08:43.211Z') is in the future. Current time is '2012-07-17T07:08:48.769Z' and allowed clock skew is '00:05:00'.

什么问题?谢谢

+3

贡献在建立社区采取代码(零验收是令人沮丧的),同时[检查:增加滞后时间(http://social.msdn.microsoft.com/forums/en-US/wcf/thread/c3bdb91c-f3e3-4670-b9b9-fe908f0595f2 /) – V4Vendetta 2012-07-17 07:28:19

+0

是的。我可以做得更好:) – 2012-07-17 08:12:09

+1

而当你想开始呢? – LPL 2012-07-21 10:44:57

回答

0

一个选项可能是(如果您不需要时间戳) - 您可以禁用添加时间戳到您的请求中的安全标头,WCF不会期望它在响应中。从this链接

// *** Don't include TimeStamp header - so server won't expect it back 
// *** This allows results returned without any Soap Headers 
BindingElementCollection elements = client.Endpoint.Binding.CreateBindingElements(); 
elements.Find<SecurityBindingElement>().IncludeTimestamp = false; 
client.Endpoint.Binding = new CustomBinding(elements);