因此,我可以在使用NetMsmqBinding时使用get my dead-letter service pulling from the queue。但是,当我改用MsmqIntegrationBinding将消息推送到目标队列时,死信队列不再向死信服务发送消息。消息不再是WCF格式的-它们只是XML序列化。我不确定如何将管道设置发送到新服务。队列和URL仍然匹配。
我尝试按原样运行(使用netMsmqBinding),切换到msmqIntegrationBinding,并指定serializationFormat,如下所示:
<bindings>
<msmqIntegrationBinding>
<binding exactlyOnce="true" durable="true" serializationFormat="Xml">
<security mode="Transport" />
</binding>
</msmqIntegrationBinding>
</bindings>然而,所有这些似乎都不起作用。任何想法都是受欢迎的。
发布于 2012-12-12 00:20:03
在使用enabling WCF tracing (使用switchValue="All")之后,我能够看到我得到了以下异常:
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的正确约定后,我遇到了这个进一步的异常:
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中,我们可以找到以下信息:
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 ),一切都开始正常工作。
https://stackoverflow.com/questions/13810430
复制相似问题