2010-05-26 109 views
2

在我們的WCF應用程序中,我嘗試配置可靠的會話。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' 行動消息被指定 無簽名的消息部分。

如果我禁用客戶端上的reliableSession,我會收到此消息: 該端點不支持該操作。只有WS-ReliableMessaging 2005年2月的消息由此端點處理。

因此,似乎服務器配置正確的RM。

我找不到任何有關我得到的錯誤的有價值的東西,所以我不知道如何解決這個問題。任何想法可能是錯誤的?

預先感謝,

羅布

回答

3

在開始一個新的測試項目,與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> 

此bindingConfiguration爲空。然後它採用與指定的不同的默認wsHttpBinding(即使只有1)。

+1

我知道這些評論是皺眉,但謝謝你謝謝你謝謝!我已經打了幾天我的頭agaist WCF超時,這是訣竅 - 我的服務配置端點沒有bindingConfiguration集。這就是訣竅,我的超時工作現在正在完善。 – 2013-09-26 15:53:49

2

我覺得對於客戶端和服務器的安全設置不匹配。

的客戶有:

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

,並且服務器有什麼都沒有.....

你可以嘗試對客戶端和服務器相同的設置?它工作嗎?

+0

啊好點,可惜它沒有任何區別,我仍然得到相同的錯誤 – Rob 2010-05-27 05:57:25

+0

看到我自己的回答,終於找到了它。 在我的測試項目中,默認情況下,默認情況下,服務器的安全設置不是默認生成的,而是客戶端上的安全設置。無論哪種情況,我的測試項目都運行正常 – Rob 2010-05-27 08:21:35