[英]getting Contract requires TwoWay (either request-reply or duplex) error
I am having WCF subscriber for MSMQ which is installed as windows service.I have attached a IErrorhandler as well.So i needed to make it OneWay= false in service contract.Now when I am starting the windows service I am getting bellow errro:- 我有作为Windows服务安装的MSMQ的WCF订阅服务器。我还附加了一个IErrorhandler。因此我需要在服务合同中将其设置为OneWay = false。现在启动Windows服务时出现以下错误:
Service cannot be started. 服务无法启动。 System.InvalidOperationException: Contract requires TwoWay (either request-reply or duplex), but Binding 'MsmqIntegrationBinding' doesn't support it or isn't configured properly to support it.
System.InvalidOperationException:合同需要TwoWay(请求-答复或双工),但是绑定“ MsmqIntegrationBinding”不支持它,或者没有正确配置为支持它。 at System.ServiceModel.Description.DispatcherBuilder.BuildChannelListener(StuffPerListenUriInfo stuff, ServiceHostBase serviceHost, Uri listenUri, ListenUriMode listenUriMode, Boolean supportContextSession, IChannelListener& result)
在System.ServiceModel.Description.DispatcherBuilder.BuildChannelListener(StuffPerListenUriInfo的东西,ServiceHostBase serviceHost,Uri listenUri,ListenUriMode listenUriMode,布尔值supportContextSession,IChannelListener和结果)
I am new to WCF.. please help me.how to configure MsmqIntegrationBinding for duplex. 我是WCF的新手,请帮助我。如何为双工配置MsmqIntegrationBinding。
my app.config section is below:- 我的app.config部分如下:-
<msmqIntegrationBinding>
<binding name="OrderProcessorBinding" maxRetryCycles="0" receiveErrorHandling="Move"
receiveRetryCount="3" retryCycleDelay="00:00:59">
<security mode="None" />
</binding>
</msmqIntegrationBinding>
The fact that you are using queueing means that conceptually your client and server are disconnected. 使用排队的事实意味着从概念上讲您的客户端和服务器已断开连接。 If you want to report exceptions back to the client you may want to re-visit your architecture to make sure you really want to use queueing.
如果要向客户端报告异常,则可能需要重新访问体系结构以确保您确实要使用队列。
This question on Stack Overflow discusses the options available for dealing with exceptions if you do decide to go down the MSMQ route: How do I handle message failure in MSMQ bindings for WCF 如果您确实决定沿着MSMQ路线前进,则关于Stack Overflow的此问题讨论了可用于处理异常的选项: 如何处理WCF的MSMQ绑定中的消息失败
There are advanced workarounds for a request-reply type behaviour over MSMQ, one is given in Lowy's excellent "Programming WCF Services book". 有一些针对MSMQ的请求-响应类型行为的高级变通方法,Lowy的出色《编程WCF服务手册》中给出了一种变通方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.