获取合同需要TwoWay(请求 - 回复或双工)错误

时间:2013-05-18 07:19:45

标签: wcf msmq msmqintegrationbinding

我有安装为Windows服务的MSMQ的WCF订阅者。我也附加了一个IErrorhandler。所以我需要在服务合同中使它成为OneWay = false。现在当我启动Windows服务时,我正在咆哮errro: -

无法启动服务。 System.InvalidOperationException:Contract需要TwoWay(请求 - 回复或双工),但是Binding' MsmqIntegrationBinding'不支持它或没有正确配置以支持它。    在System.ServiceModel.Description.DispatcherBuilder.BuildChannelListener(StuffPerListenUriInfo stuff,ServiceHostBase serviceHost,Uri listenUri,ListenUriMode listenUriMode,Boolean supportContextSession,IChannelListener& result)

我是WCF的新手.. 请帮助我。如何为双工配置MsmqIntegrationBinding。

我的app.config部分如下: -

 <msmqIntegrationBinding>
    <binding name="OrderProcessorBinding" maxRetryCycles="0" receiveErrorHandling="Move"
      receiveRetryCount="3" retryCycleDelay="00:00:59">
      <security mode="None" />
    </binding>
  </msmqIntegrationBinding>

1 个答案:

答案 0 :(得分:0)

您使用排队这一事实意味着概念上您的客户端和服务器已断开连接。如果要将异常报告回客户端,您可能需要重新访问您的体系结构,以确保您真的想要使用排队。

Stack Overflow上的这个问题讨论了如果您决定沿着MSMQ路线走下去,可用于处理异常的选项:How do I handle message failure in MSMQ bindings for WCF

对于MSMQ上的请求 - 回复类型行为有一些高级解决方法,其中一个在Lowy的优秀“编程WCF服务手册”中给出。

相关问题