Biztalk Development uses the dynamic port output file

Source: Internet
Author: User
Tags datetime sendmsg biztalk

In BizTalk Server development, many times you do not want to output a GUID string, but you want to use a date or a data item as the output file name.

In this article, we describe how to use dynamic ports to output filenames based on the current DateTime.

With dynamic ports, you can set the output file path in a BizTalk Orchestration by specifying Outport (Microsoft.XLANGs.BaseTypes.Address), where Outport is the name of the port that is created. The assignment of a port name is set in an expression.

This is illustrated by a simple example:

One, create an empty BizTalk Server Project Outfilename, set the assembly key file. For information on setting the assembly key file, refer to article 1.

Second, create a simple schema file, simpleschema.xsd, to set the type of message. and use the schema file to generate a Test.xml file for testing. For the creation of schemas, refer to document 2; For schema file generation instance files, refer to document 3;

Create a business process, add an orchestration, add a INMSG message to the process, and the type is Outfilename.simpleschema.

Iv. add a Receive Message action receivemsg, an expression setoutfilename, and a send message action sendmsg for the orchestration.

V. Add a inport port for the orchestration and receive the *. * file from the C:/in folder using the Microsoft.BizTalk.DefaultPipelines.XMLReceive pipeline.

Add a outport port for the orchestration, and use the Microsoft.BizTalk.DefaultPipelines.XMLTransmit pipeline to dynamically output the file.

Vii. Enter Outport (Microsoft.XLANGs.BaseTypes.Address) in expression setoutfilename = @ "file://c:/out/" + System.DateTime.Now.ToString ("YYYYMMDDHHMMSS") + ". xml"; code that dynamically sets the path of the output file.

Eight, connect the InPort port with the receivemsg, connect the outport port with the sendmsg, and set the receivemsg activation to ture.

Nine, compile and deployment of the project, put Test.xml into the C:/in folder below, will be produced under the C:/out folder an XML file, the file name is the current date time string.

Reference documents:

    Document 1 Biztalk Troubleshooting required Strong Name Assembly Http://blog.csdn.net/fengfangfang/archive/2006/07/11/904725.aspx
    Literature 2 How to quickly create a schema for Biztalk development http://blog.csdn.net/fengfangfang/archive/2006/07/04/874252.aspx
    Document 3 validation   http://blog.csdn.net/fengfangfang/archive/2006/07/04/874477.aspx  of schemas and instances;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.