WCF Gotcha

For the most part, WCF is pretty well behaved, especially when you use the default settings. Things just seem to work.

I have had some WCF code that has been working flawlessly for the last month. Then all of a sudden the client can't access the server.

I get the standard WCF fault error messages and start to wade through the countless websites on tracing WCF errors.

After stuffing around with half a dozen or so suggestions without success, I find a gotcha that is easily fixed, but super difficult to avoid or detect.

When you use the default windows authentication on WCF under wsHTTPbinding, it takes into consideration the timestamp on the messages being sent.
If your 2 computers have clocks that are more than 5 minutes out, then the authentication will fail and WCF will throw errors.

I had accidently adjusted the day when I had last clicked on the clock on one of my machines and now of course the timestamps didn't match.

It took me several hours to work it out. I hope this post helps out anyone that runs into the same problem.

a whole heap more WCF authentication information can be found here
http://kjellsj.blogspot.com/2007/01/wcf-security-wshttpbinding-with.html