none
ProtocolException calling WCF from a WF TransactionScope

    Question

  • Hello,

    I'm getting a SOAP exception telling: "The header 'OleTxTransaction' from the namespace 'http://schemas.microsoft.com/ws/2006/02/tx/oletx' was not understood by the recipient of this message, causing the message to not be processed. This error typically indicates that the sender of this message has enabled a communication protocol that the receiver cannot process. Please ensure that the configuration of the client's binding is consistent with the service's binding. "

    The method is defined as (by default has TransactionFlowOption.NotAllowed):

    [OperationContract]  
    Foo GetFoo(int fooId);

    Other method in the same service is defined like:

    [OperationContract]  
    [TransactionFlowOption.Allowed]  
    Foo GetFooTransactional(int fooId);

    The first one would throw the exception when called within a WF TransactionScope activity, but not when calling it from a regular console application with a TransactionScope.

    The second works in any case. I could just allow transactions in every method, but for several reasons I don't want to do that.

    I'm using named pipe bindings allowing transaction flow in clients and server. Server:

    <netNamedPipeBinding>
       
    <binding transactionFlow="true" transactionProtocol="OleTransactions" transferMode="Buffered" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" />
    </netNamedPipeBinding>

    Client:

    <netNamedPipeBinding>
       
    <binding name="DefaultNamedPipeConfig" closeTimeout="00:01:00"
             
    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
             
    transactionFlow="true" transferMode="Buffered" transactionProtocol="OleTransactions"
             
    hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288"
             
    maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
             
    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
               
    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
             
    <security mode="Transport">
                 
    <transport protectionLevel="EncryptAndSign" />
             
    </security>
         
    </binding>
     
    </netNamedPipeBinding>

     

    
    Monday, March 21, 2011 5:08 PM

All replies

  • I have also tried refreshing the references and changing the IsolationLevel of the TransactionScope, but still getting the same exception. It looks like no matter what the contract says, WF activity is always expecting to call a transactional method (the call never arrives to the service, which means the framework is rejecting it because it doesn't understand the header)
    Tuesday, March 22, 2011 11:02 AM
  • Error persists although other binding that supports transactions is used (wsHttpBinding):

    The header 'CoordinationContext' from the namespace 'http://schemas.xmlsoap.org/ws/2004/10/wscoor' was not understood by the recipient of this message, causing the message to not be processed.  This error typically indicates that the sender of this message has enabled a communication protocol that the receiver cannot process.  Please ensure that the configuration of the client's binding is consistent with the service's binding.

    Tuesday, March 22, 2011 12:54 PM