On a 2-way WCF send port, I was getting an error for some of the calls it was requesting to the webservice. It turned out that the exception only occured for very large response files that had to be responded from the webservice.
To get the response file correctly, I already had to increase the TimeOut settings on the send port for the binding of the WCF-Custom adapter. But still I got an error with following message:
Message: SP_Dummy_WCF – System.Transactions.TransactionException: The operation is not valid for the state of the transaction.
at System.Transactions.TransactionState.EnlistVolatile(InternalTransaction tx, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
at System.Transactions.Transaction.EnlistVolatile(IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.TxnBatch2..ctor(IBTTransportProxy transportProxy, ControlledTermination control, Transaction transaction, ManualResetEvent orderedEvent, Boolean makeSuccessCall)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkDeleteTxn.Execute(BizTalkExecutionContext executionContext)
So to rule out any timeouts coming from the adapter itself, I configured all the WCF TimeOuts to 1 hour.
Unfortunately, this didn’t help out a thing. So I kept looking for a correct solution.
After some digging around, I found out the transaction max time out had to be increased. If this setting is not specified, it defaults to 10 minutes, and it cannot be overridden in code even. I ended up configuring this maximum transaction time out in the machine.config files of the server. Just add following in the machine.config file and restart all host instances to solve the issue:
<machineSettings maxTimeout=”00:59:00″ />