简体   繁体   English

获得合同需要TwoWay(请求答复或双工)错误

[英]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.

相关问题 带有Apache ActiveMQ WCF绑定的双工或请求-答复配置问题 - Duplex or request-reply with Apache ActiveMQ WCF Binding configuration question WCF - 双工通道 - 请求-回复操作中的回调方法是否会出现在线程池线程中? - WCF - Duplex channel - Will the callback method within request-reply operation come in thread pool thread? 获取错误:合同需要Duplex,但Binding&#39;BasicHttpBinding&#39;不支持它,或者没有正确配置以支持它 - Getting an error: Contract requires Duplex, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it WCF路由器:一种方法和请求-答复操作 - WCF Router: one way and request-reply operations WCF双工合同 - WCF Duplex Contract 合同要求使用双工,但是绑定“ BasicHttpBinding”不支持它,或者没有正确配置为支持它 - Contract requires Duplex, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it 合同需要Duplex,但Binding'BasicHttpBinding'不支持它,或者没有正确配置以支持它 - Contract requires Duplex, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it WCF netTcpBinding 问题:合同需要双工,但绑定“BasicHttpBinding”不支持或未正确配置以支持它 - WCF netTcpBinding issue: Contract requires Duplex, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it 双工服务冻结客户端的呼叫请求/答复方法,直到发生超时 - Call request/reply method of duplex service freeze client until timeout occur 无法添加服务器引用:合同需要双工,但绑定“BasicHttpBinding”不支持或未正确配置以支持它 - Cannot add server reference: Contract requires Duplex, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM