首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在使用MsmqIntegrationBinding时实现基于IIS的死信服务

如何在使用MsmqIntegrationBinding时实现基于IIS的死信服务
EN

Stack Overflow用户
提问于 2012-12-11 06:32:47
回答 1查看 293关注 0票数 1

因此,我可以在使用NetMsmqBinding时使用get my dead-letter service pulling from the queue。但是,当我改用MsmqIntegrationBinding将消息推送到目标队列时,死信队列不再向死信服务发送消息。消息不再是WCF格式的-它们只是XML序列化。我不确定如何将管道设置发送到新服务。队列和URL仍然匹配。

我尝试按原样运行(使用netMsmqBinding),切换到msmqIntegrationBinding,并指定serializationFormat,如下所示:

代码语言:javascript
复制
<bindings>
  <msmqIntegrationBinding>
    <binding exactlyOnce="true" durable="true" serializationFormat="Xml">
      <security mode="Transport" />
    </binding>
  </msmqIntegrationBinding>
</bindings>

然而,所有这些似乎都不起作用。任何想法都是受欢迎的。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-12-12 00:20:03

在使用enabling WCF tracing (使用switchValue="All")之后,我能够看到我得到了以下异常:

代码语言:javascript
复制
An error occurred while deserializing an MSMQ message's XML body. The message cannot be received. Ensure that the service contract is decorated with appropriate [ServiceKnownType] attributes or the TargetSerializationTypes property is set on the MsmqIntegrationBindingElement.

在找到为我的每个类型添加ServiceKnownType的正确约定后,我遇到了这个进一步的异常:

代码语言:javascript
复制
The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver.  Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).

Simon Evans' Blog中,我们可以找到以下信息:

代码语言:javascript
复制
MsmqIntegrationBinding requires contracts that are designed only for its use. Unless additional behaviors are applied to the dispatcher, the service contract can contain only one service operation.

基本上,正如我们在MSDN example中看到的,使用MsmqIntegrationBinding需要一个接受所有消息的操作(Action = "*"Action = ""可能也可以)。一旦我切换到msmqIntegrationBinding并转换了我的合同(确保我在新的合同上仍然使用ServiceKnownType ),一切都开始正常工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13810430

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档