简体   繁体   English

将工作流服务与msmqIntegrationBinding一起使用

[英]Use workflow service with msmqIntegrationBinding

I have been struggling with setting up a workflow service that uses a msmqIntegrationBinding. 我一直在努力设置使用msmqIntegrationBinding的工作流服务。 The problem I have now is that I always get this serialization exception "System.ServiceModel.ProtocolException: An error was encountered while deserializing the message. The message cannot be received. ---> System.Runtime.Serialization.SerializationException: 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." 我现在遇到的问题是,我总是收到此序列化异常“ System.ServiceModel.ProtocolException:反序列化消息时遇到错误。无法接收到消息。---> System.Runtime.Serialization.SerializationException:发生了错误反序列化MSMQ消息的XML正文时,无法接收该消息。请确保服务合同已使用适当的[ServiceKnownType]属性进行修饰,或者已在MsmqIntegrationBindingElement上设置了TargetSerializationTypes属性。

As far as I have understood is that the serialization helper cannot find any types to serialize the message to even though I am using the generic type MsmqMessage<MyMessageType> both in the service contract and in the workflow. 据我了解,即使我在服务合同和工作流程中都使用通用类型MsmqMessage <MyMessageType> ,序列化帮助程序也找不到将消息序列化为的任何类型。

MyMessageType is generated from an .xsd with xsd.exe. MyMessageType是使用xsd.exe从.xsd生成的。

UPDATE: PROBLEM SOLVED I did all settings for WCF (Action, ServiceKnownType...) on the contract (interface) instead of doing it in the workflow. 更新:解决了问题我在合同(接口)上进行了WCF(动作,ServiceKnownType ...)的所有设置,而不是在工作流中进行了所有设置。 When I moved it to the workflow everything started to work!! 当我将其移至工作流程时,一切都开始工作!!

As a WCF beginner this had me a bit stumped. 作为WCF初学者,这让我有些困惑。 I had missed the [ServiceKnownType] attribute when going through a MSDN MSMQ example . 通过MSDN MSMQ 示例时,我错过了[ServiceKnownType]属性。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用MsmqIntegrationBinding或netMsmqBinding? - do I use MsmqIntegrationBinding or netMsmqBinding? MsmqIntegrationBinding是否支持多个服务操作 - Does MsmqIntegrationBinding support multiple service operations 工作流程/工作流程服务组合? 如何在“正常”工作流程中使用接收活动? - Workflow / Workflow Service combination? How to use Receive activity on 'normal' workflow? 如何将MsmqIntegrationBinding与非事务性队列一起使用? - How do I use MsmqIntegrationBinding with a non-transactional queue? WCF MsmqIntegrationBinding - WCF MsmqIntegrationBinding 使用msmqIntegrationBinding的MVC应用程序中的WCF服务不会从msmq接收消息 - WCF service inside an MVC-app that uses msmqIntegrationBinding does not receive messages from msmq 使用MsmqIntegrationBinding时如何实现基于IIS的死信服务 - How to implement IIS-based dead-letter service when using MsmqIntegrationBinding 我正在尝试设置通过MsmqIntegrationBinding调用的WCF服务,我收到错误 - I'm trying to setup a WCF Service that is called via the MsmqIntegrationBinding and I'm getting an error 工作流WCF服务(XAMLX)会使用什么服务名称 - What Service name does one use for Workflow WCF Services (XAMLX) MsmqIntegrationBinding与NetMsmqBinding相对应 - MsmqIntegrationBinding Vs NetMsmqBinding
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM