我在執行我的簡單wcf事務應用程序時遇到以下錯誤。爲什麼我的WCF事務不能正常工作?
「的‘服務1’合同上的至少一個操作被配置成與所述TransactionFlowAttribute屬性設置爲強制性的,但該通道的結合‘basicHttpBinding的’不與TransactionFlowBindingElement構成。該TransactionFlowAttribute屬性設置爲強制性未經TransactionFlowBindingElement不能使用「。
我的代碼片斷如下: Iservice1.cs
[OperationContract]
[TransactionFlow(TransactionFlowOption.Mandatory)]
bool PerformCreditTransaction(string creditAccountID, double amount);
[OperationContract, TransactionFlow(TransactionFlowOption.Mandatory)]
bool PerformDebitTransaction(string debitAccountID, double amount);
Service1.svc.cs
[OperationBehavior(TransactionScopeRequired = true)]
public bool PerformCreditTransaction(string creditAccountID, double amount)
{
//my code
}
[OperationBehavior(TransactionScopeRequired = true)]
public bool PerformDebitTransaction(string debitAccountID, double amount)
{
//my code
}
任何一個可以幫我解決這個問題?