![](/img/trans.png)
[英]Configuring WCF client gives the error "The message could not be processed. This is most likely because the action
[英]Web Service error - The message could not be processed. This is most likely because the action '' is incorrect or because
該消息包含無效的過期安全上下文令牌,或者因為綁定之間不匹配
問題是,客戶端和服務器時間縮短了幾秒鍾。 除非在客戶端/服務器關閉的幾秒鍾內進行呼叫,否則所有Web服務都可以正常工作。 因此,如果進行了呼叫,並且客戶時間是6:00:58,服務器時間是6:01:01,則會發生上述錯誤。
我添加了代碼來捕獲異常,然后再次嘗試調用,但始終收到此消息。
我已經同步了客戶端/服務器上的時間,但是最終它們不同步了幾秒鍾。
有人有什么想法嗎?
這是重要的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>
您可以配置模仿wsHttpBinding
的自定義綁定,使您可以將安全性設置上的maxClockSkew
增加到錯誤范圍之外。 看到這篇文章 。 不幸的是,您不能直接在現有的wsHttpBinding
上執行此操作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.