TransactionAutoComplete设置为false不能用于回调契约上的操作

本文关键字:契约 操作 回调 用于 设置 false 不能 TransactionAutoComplete | 更新日期: 2023-09-27 18:19:11

正常的HTTP WCF服务在试图连接到遗留的netttcp绑定时抛出此错误。我希望能够将事务流传输到服务,并启用该功能。我没有使用双工合约,所以为什么它甚至在错误消息中提到"回调"合约?

如果你需要看更多的代码,请告诉我,但我现在会接受任何建议!

**当它执行ChannelFactory.CreateChannel()时抛出错误

The operation 'XService' on callback contract 'IXService' is configured with TransactionAutoComplete set to false. TransactionAutoComplete set to false cannot be used with operations on callback contracts.
Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at IXService.Add(Int32 id, Int32 createdById, String note, Int32 productTypeId, Int32 noteTypeId)
   at XService.Add(Int32 id, Int32 createdById, String note, Int32 productTypeId, Int32 noteTypeId)

TransactionAutoComplete设置为false不能用于回调契约上的操作

我也遇到了同样的问题。我以编程方式启动了一个服务,并进行了配置(基址、绑定、端点等)。

我最终导出所有配置到配置文件,它工作。