TransactionAutoComplete设置为false不能与回调契约上的操作一起使用

时间:2014-08-22 15:18:32

标签: c# web-services wcf nettcpbinding net-tcp

正常的HTTP WCF服务在尝试连接到旧版NetTCP绑定时会抛出此错误。我希望能够将事务流向服务并启用它。我没有使用双工合同,为什么它甚至在错误消息中提到“回调”合同?

请说明您是否需要查看更多代码,但我现在会接受任何建议!

**在执行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)

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题。 我一直在开始一个服务程序,包括配置(基地址,绑定,端点......)。

我最终将所有配置导出到配置文件,然后就可以了。