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.