WSE and Timestamping - TimeZones and Tijuana
A fellow emailed me about some trouble he was having with WSE (Web Services Enhancements) and Timestamp Expiration. He was getting a SOAP Exception (Timestamp Fault) and figured it was because his machines were in different timezones. This is what I told him:
This isnt neccessarily an issue of maturity of the toolkit, its simply how TimeStamping (TTL) works on Web Services. Personally, I run my Web Servers on GMT/Universal Time to avoid even thinking about Timezones. Either way, its really about Universal Time (UTC). When you see a DateTime (when sniffing) in a Created or Expires youll notice that they append a Z (http://www.w3.org/TR/NOTE-datetime and http://www.learnmobile.net/MobileClient/Tutorials/cfWSE/) that indicates the DateTime is in UTC. Note: 1994-11-05T08:15:30-05:00 corresponds to
November 5, 1994, 8:15:30 am, US Eastern Standard Time. 1994-11-05T13:15:30Z corresponds to the same instant. (note: http://msdn.microsoft.com/webservices/building/wse/default.aspx?pull=/library/en-us/dnglobspec/html/ws-security-addendum.asp#ws-security-addendum__toc17425559 at 5.2.1. Expiration.
- What is your timestamp expiration set to? 5 seconds? 60 seconds?
- Are the client and server using an NTP server (they need to be at LEAST within 30 seconds of each other or so.
- What times are you seeing? (What does the conversation look like between the two machines...use ProxyTrace or YATT.)
- Are the machines (client and server) set to their respective timezones (in Windows Regional Settings) some people in
New Yorkjust change the system time and not the zone and the machine thinks its in . Tijuana
Its may not be an issue of hours apart; its probably minutes or seconds from UTC. Timestamping only works when the clocks are set and set well! :)
UPDATE: in classic CarTalk style it turns out it it WAS the TimeZone. If you don't tell your system WHERE it is, it can't tell you what time UTC is.