One of the reasons why the WCF client cannot access the service: Time is not synchronized

Source: Internet
Author: User
Tags net time

When using the WCF Service, the following error occurs when the client calls the service:
System. servicemodel. Security. messagesecurityexception: the other party receives an error that has not been processed or is incorrectly handled. Related errors Code And for more information, please
See Internal faultexception. ---> System. servicemodel. faultexception: at least one security token in the message cannot be verified.
--- End of the internal exception stack trace ---
Server stack trace:
In system. servicemodel. channels. securitychannelfactory '1. securityrequestchannel. processreply (Message reply, securityprotocolcorrelationstate correlationstate, timespan timeout)
In system. servicemodel. channels. securitychannelfactory '1. securityrequestchannel. Request (message, timespan timeout)
In system. servicemodel. Security. securitysessionsecuritytokenprovider. dooperation (securitysessionoperation, endpointaddress target, Uri via, securitytoken currenttoken, timespan timeout)
In system. servicemodel. Security. securitysessionsecuritytokenprovider. gettokencore (timespan timeout)
In system. identitymodel. selectors. securitytokenprovider. gettoken (timespan timeout)
In system. servicemodel. Security. securitysessionclientsettings '1. clientsecuritysessionchannel. onopen (timespan timeout)
In system. servicemodel. channels. communicationobject. Open (timespan timeout)
In system. servicemodel. channels. servicechannel. onopen (timespan timeout)
In system. servicemodel. channels. communicationobject. Open (timespan timeout)
In system. servicemodel. channels. servicechannel. callopenonce. system. servicemodel. channels. servicechannel. icallonce. Call (servicechannel channel, timespan timeout)
In system. servicemodel. channels. servicechannel. calloncemanager. callonce (timespan timeout, calloncemanager cascade)
In system. servicemodel. channels. servicechannel. ensureopened (timespan timeout)
In system. servicemodel. channels. servicechannel. Call (string action, Boolean oneway, proxyoperationruntime operation, object [] INS, object [] outs, timespan timeout)
In system. servicemodel. channels. servicechannel. Call (string action, Boolean oneway, proxyoperationruntime operation, object [] INS, object [] outs)
In system. servicemodel. channels. servicechannelproxy. invokeservice (imethodcallmessage methodcall, proxyoperationruntime Operation)
In system. servicemodel. channels. servicechannelproxy. Invoke (iMessage message)

Exception rethrown at [0]:
In system. runtime. remoting. proxies. realproxy. handlereturnmessage (iMessage reqmsg, iMessage retmsg)
In the system. runtime. remoting. proxies. realproxy. privateinvoke (messagedata & msgdata, int32 type)
In commondata. membershiprole. imembershiprole. validateuser (string username, string password)
In commondata. membershiprole. membershiproleclient. validateuser (string username, string password)
In wmsclient. loginform. bdlogin_dowork (Object sender, doworkeventargs e) In line: commondata. loggingservice. Error (: 0): Off. commondata. loggingservice
In this case, 90% is caused by inconsistent time between the client and the server. The difference between the client and the server can be 5 minutes.
The solution is to synchronize time between the client and the server.
You can run the following command: Net time \ IP address or server name/set/Yes. However, this operation has an impact on server security. Currently, I have not come up with a good solution. I wonder if you have any good methods.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.