Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

Опции темы Поиск в этой теме Опции просмотра
Старый 18.09.2009, 03:13   #1  
Blog bot is offline
Blog bot
25,339 / 844 (79) +++++++
Регистрация: 28.10.2006
emeadaxsupport: You get the following warning message in BizTalk Server 2006 R2/2009 - The message does not contain a body part

We came across an issue where you are using Microsoft Dynamics AX 2009 Asynchronous BizTalk Adapter to receive response messages from AX 2009. After just having sent an AIF UPDATE or DELETE Action message to AX, the BizTalk Server fails to consume the response message that is generated by AX. The receive location using the AX Adapter is using the default xml receive pipeline, and the "Pass Through" property of the adapter is set to 'False'

You get the following error logged in the Application Event log on the BizTalk Server:

Source: BizTalk Server 2006
Event ID: 5740
Task Category: BizTalk Server 2006
Level: Warning
The adapter "Microsoft Dynamics AX 2009" raised an error message. Details "The message does not contain a body part.".

This error is "by-design", as the Response message generated after a successful UPDATE and DELETE AIF actions does not contain a message part. Here is a sample response message:


The AX adapter will strip out the message envelope when the pass through property is set to false, and xml receive pipeline will try to parse the message body, which is empty. BizTalk cannot deal with empty messages and hence raises a warning.

Furthermore, because of the above error, the response message never gets consumed from the AIF Gateway Queue, keeping a permanent lock on the resource channel. Any other messages that are queued in the AIF Gateway Queue will failed to be consumed and you get the following errors logged on the BizTalk server:

"An X++ exception has occurred. Unable to lock resource channel ''.". The source of the message is Microsoft Dynamics AX Business Connector.

We were able to workaround the issue so that the response message in the AX AIF Gateway queue does get consumed successfully by the BizTalk Adapter for AX (and hence release the resource channel lock), by implementing the following changes in our BizTalk solution:

  • We consumed the whole message envelope instead of stripping out the xml envelope. The promoted properties are specified in the header section of the message within the envelope, hence consuming the whole message, will still allow the routing of the message within BizTalk when using the promoted properties.
  • Furthermore since you can only have one receive location communicating to one AOS server, and hence with the following changes to the BizTalk solution meant that you will always have to consume the full message including the envelope and message headers and not be able to just consume the message body:
(1) In the properties of the AX Adapter in the BizTalk receive location, Set the Pass Through property value to 'True'

(2) Create a new custom BizTalk receive pipeline, which contains the xml dissassembler pipeline component. In the properties of the pipeline component, set the Document Schemas (DocumentSpecNames) property to use the "DynamicsAX5.Message+Envelope, Microsoft.Dynamics.BizTalk.Adapter.Schemas, Version" Schema. However DO NOT SPECIFY ANY schema for the Envelope Schemas (EnvelopeSpecNames) property, leave it blank, this is essential.

(3) Change all the receive shapes in the orchestration that receive messages from AX, such that the Message Type is set to DynamicsAX5.Message.Envelope schema.

(4) Where you are using correlation for the request/response of AX messages, the Correlation Type still needs to be set to DynamicsAx5.RequestMessageId to correlate asynchronous solicit/response messages correctly.

The above steps creates a subscription in BizTalk for where the message type is the DynamicsAX5.Message.Envelope and the BizTalk Adapter for AX consumes the message correctly (In this case it will be the whole message from AX including the envelope). Once the envelope is consumed, it will get routed to the orchestration instance based on the correlation setup on the RequestMessageId property. You can then use xpath statements to extract the message body or whatever data you need from the envelope.

For example, in my sample code to extract the response message I received after a succesful AIF Delete Action I did the following:

In my orchestration in BizTalk my response message gets assigned to a BizTalk Orchestration Message called SalesOrderDeleteResponseMsg. I created two variables called xmlResponseMsg of data type System.Xml.XmlDocument, and strResponse of data type string. I then used the following xpath statement in an Expression shape to extract the xml response message and assign it to xmlResponseMsg and then extract the content from the xml message and assign it to strResponse:

xmlResponseMsg = xpath(SalesOrderDeleteResponseMsg.ReturnValue,"/*[local-name()='Envelope' and namespace-uri()='']/*[local-name()='Body' and namespace-uri()='']/*[local-name()='MessageParts' and namespace-uri()='']");

strResponse= xmlResponseMsg.OuterXml;

Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Microsoft Dynamics CRM Team Blog: Updated Dynamics CRM 4.0 Adapter Now Available – Includes Support for BizTalk Server 2009 Blog bot Dynamics CRM: Blogs 0 11.09.2009 22:05
emeadaxsupport: Kerberos authentication issues in a multi server environment affecting the KPI web part Blog bot DAX Blogs 0 26.07.2009 15:07
Microsoft Dynamics CRM Team Blog: Building a Self-Contained Virtual CRM Development Server Blog bot Dynamics CRM: Blogs 0 05.05.2009 10:05
Microsoft Dynamics CRM Team Blog: List Web Part for Microsoft Dynamics CRM 4.0 Deployment Scenarios Blog bot Dynamics CRM: Blogs 0 30.01.2009 22:05
Говорят вышел SP2 для Axapta 3. Кто нибуть что знает на эту тему? soin DAX: Прочие вопросы 10 13.10.2003 10:43
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Часовой пояс GMT +3, время: 15:22.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.