18.09.2009, 03:13 | #1 |
Участник
|
emeadaxsupport: You get the following warning message in BizTalk Server 2006 R2/2009 - The message does not contain a body part
Источник: http://blogs.msdn.com/emeadaxsupport...body-part.aspx
============== 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 Description: 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: {F0FBBBBE-2231-4529-87BA-C5F69F0663F3} Default Default http://schemas.microsoft.com/dynamic...Service/delete {64403E64-0FBA-429A-9431-41F4B5223949} 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 5.0.0.0..." 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']"); strResponse= xmlResponseMsg.OuterXml; Источник: http://blogs.msdn.com/emeadaxsupport...body-part.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|