HOW TO: Pass a Flat File from BizTalk Orchestration to BizTalk Messaging (812474)
The information in this article applies to:
- Microsoft BizTalk Server 2000
- Microsoft BizTalk Server 2002
SUMMARYThis step-by-step article describes how to set up a way to pass a flat file from BizTalk Orchestration to BizTalk Messaging. 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 describes how to use a Message Queuing queue to move a flat file between BizTalk Orchestration and BizTalk Messaging. Microsoft recommends this method because you can use BizTalk Orchestration to gain direct access to Message Queuing and Message Queuing provides transaction support. 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.
back to the
topSet Up the Private Queue- Click Start, point to Programs, click Administrative Tools, and then double-click Computer Management.
- Expand Services and
Applications.
- Expand Message Queuing.
- Right-click Private Queues, point to
New, and then click Private Queue.
- Type the name for your queue. (for example, FlatFile).
- Click to select the Transactional
check box, and then click OK.
- Locate the queue that you created in step 6, right-click this queue,
and then click Properties.
- Click the Security tab, and then click to select
the Everyone group.
- Under Allow, click to select
the Full Control check box to grant user rights.
- Click OK.
You will use this queue as an intermediary to pass the flat file
between BizTalk Orchestration and BizTalk Messaging. back to the topSet up BizTalk Messaging- 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: - 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:
- 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: - 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:
- 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: - 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: - 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: back to the
topChange the SchemaBizTalk 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: - Start BizTalk Editor.
- Open the schema that you created in step 1 of the "Set Up BizTalk
Messaging" section.
- Click the root node, and then click the
Reference tab in the right pane.
- Click Code Page, and then select Little-Endian-UTF16 (1200) from the list.
- On the File menu, click Store to
WebDAV to save the changes.
- Open the BizTalk Messaging Manager. Update the Document
Definition, the Envelope, and the Channel settings.
back to the
topConfigure the Orchestration Schedule- Start BizTalk Orchestration Designer.
- Drag the Action shape from Flowchart toolbox to the
Business Process pane.
- Double-click the Action shape, type a name (for example, Send to Message Queuing), and then click
OK.
- Drag the End shape from Flowchart toolbox to the
Business Process pane. Put this shape below
the Action shape.
- 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.
- Drag the Message Queuing component from the Implementation toolbox to
the Implementation Ports pane.
- When the Message Queuing Binding Wizard appears, do the following:
- Click to select Create a new port, type a name (for example, SendFlatFile), and then click
Next.
- Click to select Static queue, and then click Next.
- Click to select Use a known queue for all
instances. Type the name of the queue that you created in the "Set Up the Private Queue" section (for example, \private$\FlatFile), and then click
Next.
- Verify that the Transactions are required with
this queue check box is selected, and then click
Finish.
- Connect the Action shape that you created in step 2 to the Message Queuing component to start the XML Communication
Wizard.
- When the XML Communication Wizard appears, do the following:
- Click to select Send, and then click Next.
- By default, the Create a new message
option is selected. In the message name text box, type the root node name of the schema that you created for the
flat file (for example, RootNodeName), and then click
Next.
- Click to select Send message to the queue
as a string (note the text under this option), and then click
Next.
- In the Message Type Information window, click to select the Use Instance Id as Message
Label check box (the Message type text box is populated automatically. The text appears as __Instance_Id__).
- Click Finish.
back to the
topConnect the Process Flows by Using the Data Page- In BizTalk Orchestration Designer,
click the Data page.
- Double-click the Constants Message
shape.
- In the Constant Message Property dialog
box, click Add.
- When the Constant Properties dialog box appears, do the following:
- Type the name for the wrapper (for example,
StringDataWrapper).
- Set the Data type to String.
- Paste the following XML code in the Value text box:
<?xml version="1.0" ?><StringData></StringData> - Click OK.
- Click OK again.
- Drag the StringWrapper Constant element to the Document element of the RootNodeName Message shape.
 - 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. - Save and then compile the schedule.
back to the
topCreate the Message Queuing Receive Function- Open BizTalk Server Administration MMC.
- Expand the BizTalk Server
Group.
- Right-click Receive Functions, point to New, and then click
Message Queuing Receive Function.
- When the Add a Message Queuing Receive Function
dialog box appears, do the following:
- Type a name for the Message Queuing Receiving
Function.
- Select the appropriate computer running BizTalk Server from the Server on which the Receive function will run drop-down list box. (this may not be the same as the name of the Message Queuing
server).
- Type the polling location (this is the location of the
Message Queuing queue, for example, DIRECT=OS:ComputerName\Private$\FlatFile).
- Click Advanced. The
Advanced Receive Function Options appears.
- Select the envelope that you created in step 4 of the "Set Up BizTalk Messaging" section.
This is the key point in
the process of sending the flat file from BizTalk Orchestration to BizTalk Messaging. In
BizTalk Orchestration, you cannot attach an envelope to the flat file that is submitted to BizTalk Messaging. These steps permit you to bind the
envelope to the flat file that is received from the queue. This envelope provides BizTalk information about which parser BizTalk
will use to process the document. - Select the channel name from the Channel
Name drop-down list box.
- Click OK.
- Click OK again.
back to the
top
Modification Type: | Major | Last Reviewed: | 10/17/2003 |
---|
Keywords: | kbGraphxLink kbHOWTOmaster KB812474 |
---|
|
|
©2003 Microsoft Corporation. All rights reserved.
|
|