-->

Problems with WCF reliable session (reliable messa

2019-07-13 12:47发布

问题:

In our WCF application I am trying to configure reliable sessions.

Service:

 <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>

Client:

 <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>

Unfortunately I get an error which is as follows: No signature message parts were specified for messages with the 'http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence' action.

If I disable the reliableSession on the client I get this message: The action is not supported by this endpoint. Only WS-ReliableMessaging February 2005 messages are processed by this endpoint.

So it seems that the server is configured correctly for RM.

I cannot find anything valuable about the error I get so I don't know how to fix this. Any ideas what can be wrong?

Thank in advance,

Rob

回答1:

After starting a new test project that worked fine with RM I finally found the problem by comparing the configuration files. It appeared that our service configuration did not specify the correct binding configuration:

<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>

This bindingConfiguration was empty. It then takes the default wsHttpBinding which is something different then the one specified (even if there is only 1).



回答2:

I think the security settings for client and server don't match.

The client has:

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

and the server has nothing at all.....

Can you try to have the same settings for both client and server? Does it work then??