In a previous project, I worked with EDI messages to interchange with partners, but before I sent the message to the partner, I needed to pass it through a loopback adaptor, which was configured with the EDISend pipeline and the EDIReceive Pipeline.
📝 One-Minute Brief
When using a loopback adapter with EDIFACT messages to retrieve party properties, you may encounter an UnexpectedMessageTypeException. This occurs when the Receive Pipeline expects an EdifactInterchangeXml type but receives a specific transaction type instead. The solution is to configure the EDI Disassembler component in your receive pipeline by setting the PreserveInterchange property to True.
The objective is to get some properties configured in the Party so that I can proceed with the orchestration.
The send work well and creates a correct EDI message, but on the receive, I was expecting an EDI Interchange Message. I received back the message it gave me the following error:
“… Exception thrown from: segment -1, progress -1
Inner exception: Received unexpected message type ‘http://schemas.microsoft.com/BizTalk/EDI/EDIFACT/2006#EFACT_D01B_INVOIC_EAN010’ does not match expected type ‘http://schemas.microsoft.com/BizTalk/EDI/EDIFACT/2006/InterchangeXML#EdifactInterchangeXml’.
Exception type: UnexpectedMessageTypeException
Source: Microsoft.XLANGs.Engine …”
Solution
You have to configure the EDI pipeline to preserve the interchange.
In EDI Pipeline configuration:
- On the EDI disassembler component
- Set the PreserveInterchange property to True.
- Rebuild and redeploy your solution.
