Sending Messages from BizTalk Services EDI Bridge to BizTalk Services EAI Bridge

Using BizTalk Services Preview, you can configure and deploy EAI and EDI Bridges on Windows Azure.

 

EAI Bridges are configured and deployed using Visual Studio and can be used for:

  • Processing flat-file or XML messages against specified schemas
  • Transforming messages from one scheme to another
  • Routing messages to backend LOB applications like SQL Server, SAP, Oracle, and Siebel
  • Routing messages to Service Bus relay endpoints, Queues, and topics
  • Including custom-code as part of message processing
  • Etc.

EDI Bridges are configured and deployed using the BizTalk Services Portal and can be used for:

  • EDI message transfer between trading partners by using agreements
  • Sending messages to partners in batches
  • Routing messages to other endpoints deployed on Azure such as Service Bus Queues/Topics/relay endpoints, BizTalk Service Bridges, etc
  • Receiving acknowledgements for trading partners for successfully delivered messages,
  • Etc.

Needless to say that the capability to transfer messages from EDI Bridge to EAI bridge enables various enterprise scenarios for the end users. For example, you could have a scenario where an X12 message is transferred from the EDI bridge to EAI bridge, transformed into a format to insert that message into a SQL Server, and is then finally inserted in the SQL Server database. However, there’s one important consideration to make while setting up message transfer from EDI bridge to EAI bridge.

EDI To EAI Message Transfer

A single EAI bridge can be configured to process flat-file and/or XML messages. The bridge does this by using an “invisible” Decode stage in the bridge configuration. This Decode stage is enabled or disabled depending on the “content-type” header set on the incoming message. If the “content-type” of the incoming message is text/plain, the Decode stage kicks in, converts it to XML and the rest of the message processing happens on the XML message. However, if the “content-type” of the message is not text/plain, the Decode stage is skipped and the remaining processing happens.

Given that EDI bridges process X12 messages, which are flat-file messages, the content-type for the message is always set to text/plain, every time a message is routed to the EAI bridge, it has that header set, resulting in errors. So, if you are trying to send a message from EDI to EAI bridge, you must perform the following steps as part of the EDI agreement configuration that processes the message.

  1. Under Receive Settings for the agreement, click the Route page.
  2. Open the routing rule you have created under the Route Setting section. If you are creating the rule only now, skip this step.
  3. Under Route action section, specify the values as shown in the screen capture and save your changes. Redeploy the agreement.

image

 

With this configuration, when the message is routed from the EDI bridge to the EAI bridge, the content-type header is set to application/xml and the message is processed accordingly by the EAI bridge.

 

References