Configuring for Routing Received Documents to MSMQ
The following procedure can be used to configure GENTRAN: Server NT to transfer data to BizTalk Server, which in turn, then transfers the data to an application program using Microsoft Message Queuing. This procedure is very general and represents the major steps in the configuration process. Each of these steps may involve one or more detailed procedures. The detailed procedures can be found as part of the product documentation.
To configure GENTRAN: Server NT
- Configure your inbound trading partner relationship. This is a normal GENTRAN procedure.
- Create a folder on your GENTRAN server to be used to write messages inbound to MSMQ. For example: \\GENTRANServerName\ BIZTALK \MSMQ_QueueName
- Set the relationship to have an export file name of MSMQ_App1data.tmp and write the data to a shared folder. For this example, the shared folder name is
\\GENTRANServerName\ BIZTALK \MSMQ_QueueName
- Create a GENTRAN Session and Event to export data and set the Partner and Transaction you want to export. Since you defined the file name in the relationship, you do not have to enter a file here. Pseudo code for the GENTRAN session is as follows:
Process_File \\GENSRVNT\BIN\INBOUNDFILE.DAT File Delete \\GENSRVNT\BIN\INBOUNDFILE.DAT GDW_Export partnerkey & Document If Documents Exist. File Rename \\tkebisgnt31\Biztalk\MSMQ_QueueName\MSMQ_Appldata.tmp \\tkebisgnt31\biztalk\MSMQ_QueueName\MSMQ_Appldata.dat If a .tmp files exists.
- Notice the rename step in the pseudo code renaming MSMQ_App1data.tmp to MSMQ_App1data.dat. (This file is generated from the GENTRAN relationship that you configured in step #3.) This step is important because you do not want BizTalk Server polling for a file as it is being created. By renaming the file as a last step, you guarantee the file is completed before BizTalk retrieves it.
- Test the process by sending a sample message through GENTRAN for this trading partner and using your session to export it. It should end up in the shared folder \\GENTRANServerName\ BIZTALK \MSMQ_QueueName.
- The GENTRAN configuration is now complete.
To configure BizTalk Server
The following steps use BizTalk Messaging Manager:
- Create an Organization for the trading partner from whom you will be receiving documents. For this example we will use TP1 (Trading Partner 1).
- Create an application under your home organization for the destination application (if one does not exist already). This is the application to which data is being sent.
- Create a BizTalk Port for the application, which includes the MSMQ Queue. For this example, we will name this port MSMQ:App1.
- Create a Null Document Definition (NullDocDef). This is a document definition without a schema and will be used latter.
- Create a channel that uses the application, organization, port and NullDocDef created in steps 1-4. For this example, we will name it MSMQ:App1.
- Using BizTalk Server Administration tool, Create a new BizTalk File receive function to poll the share you created in the GENTRAN setup. In our example this is \\GENTRANServerName\ BIZTALK \MSMQ_QueueName
- You can name it to your own standards. It is suggested for clarity you use something similar to "MSMQ:App1:Transport" so that you can reference the process for the application in supporting the system.
- Select the server on which the receive function will run.
- Under File Types to Poll for, enter the following mask: MSMQ*.dat. You will want to set up one receive function for each trading partner.
- Under Polling location, enter the share you created: \\ServerName\ BIZTALK \MSMQ_QueueName.
- Enter a username and password if they are required to access the share.
- Click Advanced and select Submit with a pass-through flag.
Under channel, select the MSMQ:App1channel that you created above. This will cause all data submitted to this channel to process through the selected channel.
- Save the receive function.
Configuration of BizTalk Server is now complete. When you saved the receive function (Step 13), the system begins monitoring the share for files. When a file arrives, the BizTalk receive function processes the file. The result is that test file you created in the GENTRAN setup should now be processed from the share and has been sent to the MSMQ Queue defined in the messaging port created in Step 3 above.