【问题标题】:Problems with WCF reliable session (reliable messaging)WCF 可靠会话的问题(可靠消息传递)
【发布时间】:2013-04-29 17:44:56
【问题描述】:

在我们的 WCF 应用程序中,我正在尝试配置可靠的会话。

服务:

 <wsHttpBinding>
    <binding name="BindingStabiHTTP" maxBufferPoolSize="524288"
             maxReceivedMessageSize="2097152"
             messageEncoding="Text">
       <reliableSession enabled="true" ordered="true" 
                        inactivityTimeout="00:10:00"/>
          <readerQuotas maxDepth="0" maxStringContentLength="0" 
                        maxArrayLength="0" maxBytesPerRead="0"
                        maxNameTableCharCount="0" />
    </binding>
 </wsHttpBinding>

客户:

 <wsHttpBinding>
    <binding name="BindingClientWsHttpStandard" closeTimeout="00:01:00"
             openTimeout="00:01:00" receiveTimeout="00:10:00" 
             sendTimeout="00:01:00" bypassProxyOnLocal="false"
             transactionFlow="false" hostNameComparisonMode="StrongWildcard"
             maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
             messageEncoding="Text" textEncoding="utf-8" 
             useDefaultWebProxy="true" allowCookies="false">
       <readerQuotas maxDepth="32" maxStringContentLength="8192" 
                     maxArrayLength="16384" maxBytesPerRead="4096"
                     maxNameTableCharCount="16384" />
       <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="true" />
       <security mode="Message">
          <transport clientCredentialType="Windows" proxyCredentialType="None"
                     realm="" />
          <message clientCredentialType="Windows" 
                   negotiateServiceCredential="true"
                   algorithmSuite="Default" establishSecurityContext="true" />
       </security>
    </binding>

不幸的是,我收到如下错误: 没有为带有“http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence”操作的消息指定签名消息部分。

如果我在客户端禁用了可靠会话,我会收到以下消息: 此端点不支持该操作。此端点仅处理 WS-ReliableMessaging 2005 年 2 月的消息。

看来,服务器为 RM 配置正确。

我找不到任何有价值的错误信息,所以我不知道如何解决这个问题。有什么想法有什么问题吗?

提前致谢,

罗伯

【问题讨论】:

    标签: wcf ws-reliablemessaging


    【解决方案1】:

    在开始一个与 RM 配合良好的新测试项目后,我终于通过比较配置文件发现了问题。看来我们的服务配置没有指定正确的绑定配置:

    <service behaviorConfiguration="somebehavior"
             name="somename">
       <endpoint address="" binding="wsHttpBinding" 
                 bindingConfiguration="SomeBinding"
                 name="http" 
                 contract="somecontract" />
       <endpoint address="mex" 
                 binding="mexHttpBinding" 
                 bindingConfiguration=""
                 name="mex" 
                 contract="IMetadataExchange" />
       <host>
          <baseAddresses>
             <add baseAddress="http://localhost:8731/Design_Time_Addresses/somelibrary/someservice/" />
          </baseAddresses>
       </host>
    </service>
    

    此绑定配置为空。然后它采用默认的 wsHttpBinding,它与指定的不同(即使只有 1 个)。

    【讨论】:

    • 我知道这些 cmets 不受欢迎,但是谢谢谢谢谢谢!几天来,我一直在反对 WCF 超时,这就是诀窍——我的服务配置端点没有设置 bindingConfiguration。这就是诀窍,我的超时现在工作得很好。
    【解决方案2】:

    我认为客户端和服务器的安全设置不匹配。

    客户有:

    <security mode="Message">
       <transport clientCredentialType="Windows" 
                   proxyCredentialType="None" realm="" />
       <message clientCredentialType="Windows" negotiateServiceCredential="true"
                 algorithmSuite="Default" establishSecurityContext="true" />
    </security>
    

    而服务器什么都没有.....

    您可以尝试为客户端和服务器设置相同的设置吗?那有效果吗?

    【讨论】:

    • 好点,不幸的是它没有任何区别,我仍然得到同样的错误
    • 看我自己的答案,终于找到了。在我的测试项目中,默认情况下似乎不会生成服务器的安全设置,而客户端上的安全设置是默认生成的。无论哪种情况,我的测试项目都运行良好。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-03-23
    • 1970-01-01
    • 2016-06-14
    • 2011-07-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多