简体   繁体   English

Web服务错误-无法处理该消息。 这很可能是因为操作“”不正确或

[英]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.

相关问题 配置 WCF 客户端会出现错误“无法处理消息。这很可能是因为操作 - Configuring WCF client gives the error "The message could not be processed. This is most likely because the action 发布服务时,可能导致“导出操作由于具有通配符操作而被跳过”错误的原因是什么? - What could cause “An operation was skipped during export because it has a wildcard action” error when publishing a service? 无法处理该消息,因为“http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/SCT”操作无效或无法识别。 - The message could not be processed because the action 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/SCT' is invalid or unrecognized. 错误消息:由于身份验证失败,无法满足对安全令牌的请求 - Error message: The request for security token could not be satisfied because authentication failed WCF 服务失败 无法调度消息,因为端点地址处的服务对于该地址的协议不可用 - WCF service failing The message could not be dispatched because the service at the endpoint address is unavailable for the protocol of the address WCF Singleton-Service错误:提供的服务类型不能作为服务加载,因为它没有默认构造函数 - WCF Singleton-Service error: The service type provided could not be loaded as a service because it does not have a default constructor WCF - 无法分派消息,因为端点地址处的服务...对于地址协议不可用 - WCF - The message could not be dispatched because the service at the endpoint address … is unavailable for the protocol of the address 无法分派该消息,因为端点地址net.tcp:// localhost /上的服务不适用于该地址的协议 - The message could not be dispatched because the service at the endpoint address net.tcp://localhost/ is unavailable for the protocol of the address WCF错误:无法在接收方处理带有操作的消息 - WCF Error: The message with Action cannot be processed at the receiver WCF Web服务无法从IIS运行,因为无法加载DLL? - WCF web service fail run from the IIS because could not load DLL?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM