无法接收从 CRM 发送到 Azure Biztalk 服务中的服务总线队列的 RemoteExecutionContext 消息

Cannot receive RemoteExecutionContext messages sent from CRM to Service Bus Queue in Azure Biztalk Service

我无法找到从 MS CRM 发送到 Azure 服务总线队列的 RemoteExecutionContext 的有效架构,因此我尝试了直通桥以及使用虚拟桥的单向 Xml 桥架构

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://schemas.microsoft.com/xrm/2011/Contracts"
    xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
    targetNamespace="http://schemas.microsoft.com/xrm/2011/Contracts"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="RemoteExecutionContext">
    <xs:complexType>
      <xs:sequence>
        <xs:any minOccurs="0" maxOccurs="unbounded" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

处理队列中的消息始终失败并显示

Error = Object reference not set to an instance of an object.
happened while submitting message to gateway.
ItemId = 8e9284315e104a759353769633b7c4c2,
RequestId = b442f176-2007-44a6-b818-801bc74f3e2b,
GatewayAddress = default./passthroughbridge1,
PullEndpointName = OutChannelQueue,
PartitionId = 1,
PullRuntimeUrl = 029ba68d-9696-46bf-bd1e-88b8bddff4a8OutChannelQueue;
TraceSource 'Microsoft-Integration-TransportService' event

我将发送到 Azure 的步骤直接注册到 ServiceEndpoint,而不是编写用于发布插件执行上下文的插件。

Peek/Receiving 来自队列的消息使用简单的控制台应用程序工作没有问题,所以我会排除身份验证或连接字符串问题。

我找不到任何使用 Azure Biztalk 服务从队列接收 RemoteExecutionContext 消息的示例。

事实证明,我完全没有注意到 Azure Biztalk 服务无法接收二进制消息的限制 - 即使您尝试传递它们并尝试在自定义步骤中序列化它们。

我的解决方案是在不使用 MS CRM 提供的服务端点注册的情况下编写 Xml 消息以发送到自定义插件中的 Azure 服务总线队列。


更新 2016 更新 1 将允许配置消息格式并支持二进制、xml 和 json 格式的消息形成服务端点注册。有关详细信息,请参阅 Walkthrough: Configure Microsoft Azure (SAS) for integration with Dynamics CRM。请注意配置对话框与以前版本的差异。