【问题标题】:Use workflow service with msmqIntegrationBinding将工作流服务与 msmqIntegrationBinding 一起使用
【发布时间】:2012-11-20 17:36:41
【问题描述】:

我一直在努力设置使用 msmqIntegrationBinding 的工作流服务。我现在遇到的问题是我总是得到这个序列化异常“System.ServiceModel.ProtocolException:反序列化消息时遇到错误。无法接收消息。---> System.Runtime.Serialization.SerializationException:反序列化 MSMQ 消息的 XML 正文时出错。无法接收该消息。请确保使用适当的 [ServiceKnownType] 属性装饰服务协定或在 MsmqIntegrationBindingElement 上设置 TargetSerializationTypes 属性。"

据我了解,即使我在服务合同和工作流程。

MyMessageType 是从带有 xsd.exe 的 .xsd 生成的。

更新:问题已解决 我在合同(接口)上为 WCF(Action、ServiceKnownType...)进行了所有设置,而不是在工作流中进行。当我将它移到工作流程中时,一切都开始工作了!!

【问题讨论】:

    标签: wcf workflowservice msmqintegrationbinding


    【解决方案1】:

    作为一个 WCF 初学者,这让我有点难过。通过 MSDN MSMQ example 时,我错过了 [ServiceKnownType] 属性。

    [ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples")]
    [ServiceKnownType(typeof(PurchaseOrder))]
    public interface IOrderProcessor
    {
        [OperationContract(IsOneWay = true, Action = "*")]
        void SubmitPurchaseOrder(MsmqMessage<PurchaseOrder> msg);
    }
    

    【讨论】:

      猜你喜欢
      • 2010-12-13
      • 2011-08-05
      • 1970-01-01
      • 2023-03-09
      • 1970-01-01
      • 1970-01-01
      • 2016-01-18
      • 1970-01-01
      • 2010-10-30
      相关资源
      最近更新 更多