[英]Web Service error - The message could not be processed. This is most likely because the action '' is incorrect or because
the message contains an invalid expired security context token or because there is a mismatch between bindings
该消息包含无效的过期安全上下文令牌,或者因为绑定之间不匹配
The problem is, the client and the server times are a few seconds off. 问题是,客户端和服务器时间缩短了几秒钟。 The web services all work fine, unless the call is made in between the few seconds that the client/server are off.
除非在客户端/服务器关闭的几秒钟内进行呼叫,否则所有Web服务都可以正常工作。 So, if the call is made, and the client time is 6:00:58, and the server time is 6:01:01, the error above occurs.
因此,如果进行了呼叫,并且客户时间是6:00:58,服务器时间是6:01:01,则会发生上述错误。
I have added code to catch the exception, and try the call again, but keep getting this message. 我添加了代码来捕获异常,然后再次尝试调用,但始终收到此消息。
I have synced the times on client/server, but they eventually get out of sync be a few seconds. 我已经同步了客户端/服务器上的时间,但是最终它们不同步了几秒钟。
Does anyone have any ideas? 有人有什么想法吗?
Here is part of the web config that matters (everything between client/server is same) : 这是重要的Web配置的一部分(客户端/服务器之间的所有内容都相同):
<service behaviorConfiguration="WebServiceBehavior" name="WebService.TestService">
<endpoint
address=""
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_Service"
contract="WebService.ITestService">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="./WebService/TestService/" />
</baseAddresses>
</host>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_Service" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="1000000" maxReceivedMessageSize="1000000" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="false" allowCookies="false">
<readerQuotas maxDepth="900000" maxStringContentLength="900000" maxArrayLength="900000" maxBytesPerRead="900000" maxNameTableCharCount="900000" />
<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" establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="WebServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.web>
<customErrors mode="On" />
<identity impersonate="false" />
<authentication mode="Forms" />
</system.web>
You can configure a custom binding that mimics wsHttpBinding
that will let you increase the maxClockSkew
on the security settings to be outside the error range. 您可以配置模仿
wsHttpBinding
的自定义绑定,使您可以将安全性设置上的maxClockSkew
增加到错误范围之外。 See this article . 看到这篇文章 。 Too bad you can't do it directly on the existing
wsHttpBinding
. 不幸的是,您不能直接在现有的
wsHttpBinding
上执行此操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.