Paul's Petrov Whiteboard

[BizTalk, Enterprise Application Integration, Business Process Automation, SOA, .NET]

  Home  |   Contact  |   Syndication    |   Login
  56 Posts | 1 Stories | 96 Comments | 30 Trackbacks

News

Archives

Post Categories

Image Galleries

BizTalk

Other

Recently, while debugging desktop client - WCF service application I came across this error:

System.ServiceModel.Security.MessageSecurityException was caught
Message=”An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.”
Source=”mscorlib”
StackTrace:
Server stack trace:
at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout)
at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

InnerException: System.ServiceModel.FaultException
Message=”An error occurred when verifying security for the message.”

Client was connecting basic http binding with security mode TransportWithMessageCredential. All other desktop clients were able to successfully call WCF service but not this particular one. Thanks to this post the issue was quickly understood and resolved. Apparently, the client machine was a brand new netbook just out of the box and clock was way off. Interesting thing that Windows automatic clock synchronization did not work.

 

posted on Tuesday, August 11, 2009 9:59 AM

Feedback

# re: WCF Message Authentication Failure 10/30/2009 1:15 PM Fábio Demarchi
Try to disable the synchronizing computer time with an Internet time server, following these steps:

*** If you are a member of a domain, just ignore my tip, 'cos in this case the "Internet Time" tab does not appear for you.

1. Double-click the time on the Windows XP Taskbar to open the "Date and Time Properties" multi-tabbed dialog box;
2. When this dialog box appears, click the "Internet Time" tab;
3. Uncheck "Automatically synchronize with an Internet time server";
4. Don't forget to check/adjust your clock;
5. Click "OK" to close the dialog box;
6. Finally, proceed with your test!

Let me know if this helped you.
All the best,

Fábio Demarchi
Systems Analyst
fabiodemarchi@gmail.com
fabiodemarchi@googlewave.com

# re: WCF Message Authentication Failure 11/24/2009 2:21 AM Dev
Yes, it really works. Thanks alot

# re: WCF Message Authentication Failure 1/13/2010 2:36 AM loverwei
it works well,but why?

# re: WCF Message Authentication Failure 2/4/2010 12:14 PM DavidHalligan
I would be guessing but, message authentication in WCF by default encrypts the credentials. Encryption usually depends upon some type of salt / seed which can be based upon the current system time. My guess is that the date / time on the client and server is not insignificantly out of step resulting in the encryption / decryption failing.

# re: WCF Message Authentication Failure 3/9/2010 2:48 PM Gregg McGilvray
Thanks, you saved me a ton of time. My servers were off by less than 5 minutes and failed. hen I synced them my app ran fine.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: