Biztalk development uses XML data items to construct the output file path

Source: Internet
Author: User

For the use of dynamic port output files, Fred proposes how to avoid overwriting files and how to use an XML data item as part of a file name. This article briefly describes how to implement.

One, create an empty BizTalk Server Project Dynamicoutfile, 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. Upgrade the UserID node as shown in the figure.



Third, 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, and add inmsg and OUTMSG messages to the process, all of which are of type Outfilename.simpleschema.

V. Add a Receive Message action Receivemsg, a message assignment assignoutmsg, and a send message action sendmsg for the orchestration. Constructs a message together with the message assignment, sets the name to Constructoutmsg, and sets the constructed message to outmsg.

Vi. 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.

Eight, the expression of setting assignoutmsg is:


outmsg=inmsg;
Outmsg (FILE. Copymode) = 0;
OutPort (Microsoft.XLANGs.BaseTypes.Address) =@ "file://c:/out/" +
System.DateTime.Now.ToString ("yyyyMMdd") + "_" +
Inmsg (Dynamicoutfile.userid) + ". xml";

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

Compile and program the project, put the Test.xml into the C:/in folder below, and test.

--------------------------------------------------------------------------------

Reference documents:

Document 1 Biztalk Troubleshooting required Strong Name Assembly Http://blog.csdn.net/fengfangfang/archive/2006/07/11/904725.aspx
Document 2 How to quickly create a schema for Biztalk development http://blog.csdn.net/fengfangfang/archive/2006/07/04/874252.aspx
Document 3 Validation of schemas and examples http://blog.csdn.net/fengfangfang/archive/2006/07/04/874477.aspx
Document 4 using the dynamic port output file http://blog.csdn.net/fengfangfang/archive/2006/08/02/1010087.aspx

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.