问题
I'm using the WSE 3.0 UsernameToken to communicate with a network camera. Due the time difference between my PC and the network camera I can't authenticate, the allowed time difference is +- 5 sec UTC time, my current difference is 59 minutes and 19 seconds. The problem is that when I create the UsernameToken instance, the Created property is already set, and it's read only.
var token = new UsernameToken(Username, Password, PasswordOption.SendHashed);
I've tried to change manually the xmlelement generated by the UsernameToken instance to correct the time gap, but keep getting error 400.
XmlElement securityToken = token.GetXml(new XmlDocument());
securityToken.ChildNodes[3].InnerText = time.ToString("yyyy-MM-ddTHH:mm:ss.fffZ");
来源:https://stackoverflow.com/questions/26767093/how-to-set-the-creation-time-for-the-wse-3-0-usernametoken