Transactions WCF NetTcp Exception

I have a Receive Location using WCF-NetTcp binding, and Trnsactionas enabled (Ole). The Receive handler is the BizTalkServerApplication. There is also a Receive Port oy type One-Way for this Receive Location.

Generated a client from the published metadata, which sends several messages within one transactions to the Receive Location. Code looks like this:

Code Snippet

Service1Client client =newService1Client();

using (TransactionScope scope =newTransactionScope())

{

for (int i = 0; i < 5; i++)

{

Order o =newOrder();

o.One = i;

o.Two =DateTime.Now.ToString();

client.Operation1(o);

}

scope.Complete();

}

client.Close();

in the client config binding section the following are set:

Code Snippet

transactionFlow="true"

<reliableSessionordered="true"inactivityTimeout="00:10:00"

enabled="true" />

However when calling the service the following exception is raised:

The remote endpoint has sent an unrecognized fault with namespace,http://www.w3.org/2003/05/soap-envelope, name Sender, and reason The service operation requires a transaction to be flowed.. The channel could not be opened.

Have I missed something... a setting perhaps?

Cheers

[3583 byte] By [BenECM] at [2008-2-19]
# 1

Taking a quick look, In your client try this code:

using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required ))

HTH
DwightGoins at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 Adapters and Adapter Pack...
# 2

Dwight - since TransactionScopeOption.Required is the default - and what the default constructor does - you code and his code are exactly the same.

Ben - check the generated client proxy code. Is the TransactionFlowAttribute on the Operation?

JonFlanders at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 Adapters and Adapter Pack...
# 3

Jon hi thanks, just to clarify for others

The client proxy interface needs to the attribute on the operation.

TransactionFlowAttribute(TransactionFlowOption.Mandatory)]

To solve the problem re-published the service metadata enpoint into IIS and regenerated the proxy with svcutil. There was no need to hand craft the proxy code, svcutil was did the job this time.

This version has the above attribute.

All works now.

BenECM at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 Adapters and Adapter Pack...