Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I consume wcf service with wsHttpBinding then i face following error

"The security timestamp is invalid because its creation time ('2014-11-05T06:23:30.868Z') is in the future. Current time is '2014-11-05T06:17:07.406Z' and allowed clock skew is '00:05:00'."


Use this code in config file

<wshttpbinding>
<binding name="WSHttpBinding_IPatientService" closetimeout="00:01:00">
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerquotas maxdepth="32" maxstringcontentlength="8192" maxarraylength="16384">
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliablesession ordered="true" inactivitytimeout="00:10:00">
enabled="false" />
<security mode="Message">
<transport clientcredentialtype="Windows" proxycredentialtype="None"> realm="" />
<message clientcredentialtype="Windows" negotiateservicecredential="true">
algorithmSuite="Default" />




<client>
<endpoint address="http://172.16.4.118/HIS.PatientService/PatientService.svc">
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IPatientService"
contract="PatientService.IPatientService" name="WSHttpBinding_IPatientService">
<identity>
<dns value="localhost">


Posted

1 solution

Hi,

This exception occurs when the service binding has a security binding element, and the difference of the client/server clocks is larger than the allowed value (the default is 5 minutes). In your case it seems like they are apart by about 5'16". There are two alternatives you can consider to solve this problem:

- Make sure that the client and server clocks are more in sync (if they have access to a common network time server, a "net time" command should help)

- Increase the allowed skew. This setting is not available on standard bindings, you'd have to convert it to a custom binding and update this value on the security binding element.

And since you're defining the binding via config, add this:
XML
<bindings>
<custombinding>
 <binding name="MaxClockSkewBinding">
     <textmessageencoding />
     <security>
        <localclientsettings maxclockskew="00:10:00" />
        <localservicesettings maxclockskew="00:10:00" />
       <secureconversationbootstrap />
     </security>
     <httptransport />
 </binding>
</custombinding>
</bindings>


Hope this helps !! :)

Regards,
Praneet
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900