The ability to send and to receive flat file data is critical in many business processes. You may have to send or receive flat file data from earlier systems, trading partners, or existing COM components. You can use the BizTalk Orchestration Designer to design business processes for sending, receiving, and manipulating flat file data, and then compile these processes in an XLANG schedule.
You may experience problems when you try to send a flat file from BizTalk Orchestration to BizTalk Messaging. In the Orchestration Designer, there is no built-in way to specify the flat file envelope that you must use to submit a flat file to BizTalk Messaging. However, there are two possible workarounds to this limitation:
� | Use a Microsoft Message Queuing (also known as MSMQ) queue. |
� | Use the File System as an intermediary between BizTalk Orchestration and BizTalk Messaging. |
This article also describes how to create a Message Queuing Receive function. This Receive function reads the flat file out of the Message Queuing queue, and then submits the file to BizTalk Messaging with the correct envelope.
Note The Unicode character set is used to write flat file data to the Message Queuing queue. Because the file data is in Unicode, the submitted document will not pass validation when it is read to BizTalk Messaging. To make sure that the flat file is successfully validated, you must change the schema that is validating the document. To do this, set the value of the Code Page property of the root node under the Reference tab to Little-Endian-UTF16 (1200).
The following assumptions are made in this article:
� | You have already created a schema for the flat file. If you have not created this schema, see the "Set Up BizTalk Messaging" section of this article for information about how to create each of the components. |
� | You use the same flat file schema for the envelope. |
� | Your Orchestration schedule already contains an action that is configured to receive a flat file message through a COM component or through a Script component. If you do not have a COM component or a Script component to retrieve a flat file, see the "More Information" section for information about how to create a sample Windows Scripting Component. |
Set Up the Private Queue
1. | Click Start, point to Programs, click Administrative Tools, and then double-click Computer Management. |
2. | Expand Services and Applications. |
3. | Expand Message Queuing. |
4. | Right-click Private Queues, point to New, and then click Private Queue. |
5. | Type the name for your queue. (for example, FlatFile). |
6. | Click to select the Transactional check box, and then click OK. |
7. | Locate the queue that you created in step 6, right-click this queue, and then click Properties. |
8. | Click the Security tab, and then click to select the Everyone group. |
9. | Under Allow, click to select the Full Control check box to grant user rights. |
10. | Click OK. |
Set up BizTalk Messaging
1. | Create a schema to represent the flat file that you want to
submit from BizTalk Orchestration. For more information about how to create a schema by using the BizTalk Editor, visit the following Microsoft Web site: |
2. | Create a map to transform the source flat file to the
destination format that you want. For more information about how to create a map by using the BizTalk Mapper, visit the following Microsoft Web site: |
3. | Create the document definitions for inbound and outbound
documents. For more information about how to create a document definition by using the BizTalk Messaging Manager, visit the following Microsoft Web site: |
4. | Create the envelope to provide the information that BizTalk
must have to open an inbound flat file. For more information about how to create an envelope by using the BizTalk Messaging Manager, visit the following Microsoft Web site: |
5. | Create the source organization and the destination organization for the
flat file. For more information about how to create an organization by using the BizTalk Messaging Manager, visit the following Microsoft Web site: |
6. | Create a port to provide the details about the destination
location. BizTalk uses this information to send the output that the mapping
process creates. For more information about how to create a port by using the BizTalk Messaging Manager, visit the following Microsoft Web site: |
7. | Create a channel to process the submitted
document. For more information about how to create a channel by using the BizTalk Messaging Manager, visit the following Microsoft Web site: |
Change the Schema
BizTalk Orchestration uses the Unicode character set to write the flat file to the queue. Therefore, you must provide the information for BizTalk Messaging to process the document. To do this, follow these steps:1. | Start BizTalk Editor. |
2. | Open the schema that you created in step 1 of the "Set Up BizTalk Messaging" section. |
3. | Click the root node, and then click the Reference tab in the right pane. |
4. | Click Code Page, and then select Little-Endian-UTF16 (1200) from the list. |
5. | On the File menu, click Store to WebDAV to save the changes. |
6. | Open the BizTalk Messaging Manager. Update the Document Definition, the Envelope, and the Channel settings. |
Configure the Orchestration Schedule
1. | Start BizTalk Orchestration Designer. | ||||||||||
2. | Drag the Action shape from Flowchart toolbox to the Business Process pane. | ||||||||||
3. | Double-click the Action shape, type a name (for example, Send to Message Queuing), and then click OK. | ||||||||||
4. | Drag the End shape from Flowchart toolbox to the Business Process pane. Put this shape below the Action shape. | ||||||||||
5. | Draw a line from the action in your schedule that is receiving the flat file to the Action shape, and then draw a line from the Action shape to the End shape. | ||||||||||
6. | Drag the Message Queuing component from the Implementation toolbox to the Implementation Ports pane. | ||||||||||
7. | When the Message Queuing Binding Wizard appears, do the following:
| ||||||||||
8. | Connect the Action shape that you created in step 2 to the Message Queuing component to start the XML Communication Wizard. | ||||||||||
9. | When the XML Communication Wizard appears, do the following:
|
Connect the Process Flows by Using the Data Page
1. | In BizTalk Orchestration Designer, click the Data page. | ||||||||||
2. | Double-click the Constants Message shape. | ||||||||||
3. | In the Constant Message Property dialog box, click Add. | ||||||||||
4. | When the Constant Properties dialog box appears, do the following:
| ||||||||||
5. | Drag the StringWrapper Constant element to the Document element of the RootNodeName Message shape. | ||||||||||
6. | Drag a connection from the field that references the flat
file string to the StringData field on the RootNodeName Message shape. Note: This is the OUT field for the COM component or the Scripting component that your schedule receives the flat file from. For example, if your scripting component has a RetrieveFile method that is bound to the incoming port, you will have a RetrieveFile_out message on the Data page. The RetrieveFile_out message will contain a RetrieveFile field. In this scenario, you drag a connection from the RetrieveFile field to the StringData field on the RootNodeName Message shape. | ||||||||||
7. | Save and then compile the schedule. |
Create the Message Queuing Receive Function
1. | Open BizTalk Server Administration MMC. | ||||||||||||||||
2. | Expand the BizTalk Server Group. | ||||||||||||||||
3. | Right-click Receive Functions, point to New, and then click Message Queuing Receive Function. | ||||||||||||||||
4. | When the Add a Message Queuing Receive Function
dialog box appears, do the following:
|