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
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:
(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 22.214.171.124..." 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()='http://schemas.microsoft.com/dynamics/2008/01/documents/Message']/*[local-name()='Body' and namespace-uri()='http://schemas.microsoft.com/dynamics/2008/01/documents/Message']/*[local-name()='MessageParts' and namespace-uri()='http://schemas.microsoft.com/dynamics/2008/01/documents/Message']");
Расскажите о новых и интересных блогах по 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|
|Опции темы||Поиск в этой теме|