IOneWayAsync vs IOneWayAsyncTxn - Bug?
Greetings all,
I've noticed that when using the BAM R2 interceptors with WCF adapters, the Out of the Box implementation of IOneWayAsync and IOneWayAsyncTxn seem to be the exact same interfaces.
Ex:
[ServiceContract(Namespace="http://www.microsoft.com/biztalk/2006/r2/wcf-adapter")]
public interface IOneWayAsync
{
// Methods
[OperationContract(AsyncPattern=true, IsOneWay=true, Action="*")]
IAsyncResult BeginOneWayMethod(Message message, AsyncCallback callback, object state);
[OperationContract(IsOneWay=true, Action="BizTalkSubmit")]
void BizTalkSubmit(Message message);
void EndOneWayMethod(IAsyncResult result);
}
[ServiceContract(Namespace="http://www.microsoft.com/biztalk/2006/r2/wcf-adapter")]
public interface IOneWayAsyncTxn
{
// Methods
[OperationContract(AsyncPattern=true, IsOneWay=true, Action="*")]
IAsyncResult BeginOneWayMethod(Message message, AsyncCallback callback, object state);
[OperationContract(IsOneWay=true, Action="BizTalkSubmit")]
void BizTalkSubmit(Message message);
void EndOneWayMethod(IAsyncResult result);
}
Where the TwoWay version of these makes it obviously clear that the xxxTXN version must have a Transaction flowed into its context, such as the following:
[ServiceContract(Namespace="http://www.microsoft.com/biztalk/2006/r2/wcf-adapter")]
public interface ITwoWayAsyncVoid
{
// Methods
[OperationContract(AsyncPattern=true, IsOneWay=false, Action="*", ReplyAction="*")]
IAsyncResult BeginTwoWayMethod(Message message, AsyncCallback callback, object state);
[OperationContract(IsOneWay=false, Action="BizTalkSubmit")]
void BizTalkSubmit(Message message);
void EndTwoWayMethod(IAsyncResult result);
}
[ServiceContract(Namespace="http://www.microsoft.com/biztalk/2006/r2/wcf-adapter")]
public interface ITwoWayAsyncVoidTxn
{
// Methods
[TransactionFlow(TransactionFlowOption.Mandatory), OperationContract(AsyncPattern=true, IsOneWay=false, Action="*", ReplyAction="*")]
IAsyncResult BeginTwoWayMethod(Message message, AsyncCallback callback, object state);
[OperationContract(IsOneWay=false, Action="BizTalkSubmit"),TransactionFlow(TransactionFlowOption.Mandatory)]
void BizTalkSubmit(Message message);
void EndTwoWayMethod(IAsyncResult result);
}
Shouldn't the IOneWayAsyncTxn also do the same... such as:
[ServiceContract(Namespace="http://www.microsoft.com/biztalk/2006/r2/wcf-adapter")]
public interface IOneWayAsyncTxn
{
// Methods
[OperationContract(AsyncPattern=true, IsOneWay=true?, Action="*"), TransactionFlow(TransactionFlowOption.Mandatory)]
IAsyncResult BeginOneWayMethod(Message message, AsyncCallback callback, object state);
[OperationContract(IsOneWay=true?, Action="BizTalkSubmit") TransactionFlow(TransactionFlowOption.Mandatory)]
void BizTalkSubmit(Message message);
void EndOneWayMethod(IAsyncResult result);
}
Is this a bug? Or more an architectural decision when dealing with WCF transactions? Also, is the above event possible considering that a transaction would need to send a Commit/Abort back, thus it wouldn't really be IsOneWay=true but rather IsOneWay=false, which effectively makes it the same as a ITwoWayAsyncVoidTxn?
-Thinking Out Loud (TOL)
-Dwight

