Biztalk series (7) Hello World2

Source: Internet
Author: User
Tags custom name biztalk

Previously, according to the BizTalk subscription principle, the first application Hello world was created on the BizTalk console. However, due to the limited development functions of the console, the vast majority of BizTalk programs are implemented in the integrated development environment Visual Studio. Next we will create the hello World2 program under Visual Studio. The function is to combine the two fields of the source message into a third field and save it to the Target message. [As follows]


  

This program is mainly used to familiarize yourself with the development components related to BizTalk, including schema, mapping, pipeline, and orchestration. Receive/send port configuration. The following are the development steps:

1. Create an application

Open visual stuido and clickFile->New->ProjectEnter the corresponding name and path in the program name and path. ClickOKCreate an application

2. Create a schema)

Right-click the BizTalk project and clickAdd->New item. In the pop-up dialog box, select the schema file in the left-side navigation bar and select schema in the template on the right. Select the name of the input schema in the name.

   

 

 

In the open schema Editor, right-click root and clickInsert schema Node->Child field element.

Create two child elements in sequence and name them para1 and para2 (the default element is a string value ). The schema namespace defaults.

  

 

Follow these steps to create the target schema. The file name is targetschema. The architecture view is as follows:

2. Create a map)

Right-click the BizTalk project and clickAdd->New item. In the pop-up dialog box, select the map file in the left navigation bar and select map in the template on the right. Select the name of the input map in the name.

 

ClickOpen source SchemaIn the displayed dialog box, selectBtshelloworld2.sourceschema. ClickOpen destination schema.In the displayed dialog box, selectBtshelloworld2.targetschema.

Connect the source and target nodes based on the open-source and target architectures. The string node of the target architecture is connected by para1 and para2. In the map editing tool window, selectString concatenateFunctoid.

3. Create a Business Process (orchestration)

 

3.1 As mentioned above. Right-click the BizTalk project and clickAdd->New item. In the pop-up dialog box, select the orchestration file in the left-side navigation bar, and select Orchestration in the template on the right. Select the name of the input orchestration.

3.2 Create a message. Open the orchestration file and create two messages in the orchestration View window: sourchmsg and trgetmsg. The types are btshelloworld2.sourceshema and btshelloworld2.targetschema. If there is no orchestration view in the current editing environment, you canView->Other windows->Orchestration ViewOpen View

3.3 create and configure business processes

The configured flowchart is shown in. The steps below are required to implement this process.

  • Select from the toolbarReceive,Transform,SendThe three shapes are arranged as shown in an image.
  • In the Properties window of the receive shapeMessageSelect the createdSourcemsg. Double-click transform and selectExisting MappingsSelect btshelloworld. stringmap in the drop-down box.SourceAndDestinationSelectSourcemsgAndTargetmsg. In the send shape property windowMessageSelect the createdTargetmsg
  • In the Properties window of the receive shapeActiveAttribute SelectionTrue.Indicates the active port to activate the Business Process instance.
  • Create a receiving port: select the port shape from the toolbar and drag it to the left-side port surface. In the Port Configuration Wizard, enter the following information as prompted:Port name,Port type,"Receive messages from this port""Configure later".
  • Create a sending port: select the port shape from the toolbar and drag it to the right port surface. In the Port Configuration Wizard, enter the following information as prompted:Port name,Port type,"Send messages from this port""Configure later".

 

4. Create a pipeline for receiving messages)

4.1 receiving pipeline (receive pipeline)

As mentioned above. Right-click the BizTalk project and clickAdd->New item. In the pop-up dialog box, select the pipeline file in the left navigation bar, and select receive pipeline in the template on the right. Select the name of the input pipeline.

Open the receive pipeline, select the XML discycler component from the toolbox, and drag and drop it to the disassemble stage.

4.2 send Pipeline)

The method for creating a sending pipeline is similar to that for a receiving pipeline, but you can select a sending pipeline when selecting a template. In the pipeline Editor, select the XML assemble component and drag it to the assemble stage. As shown in:

5. Deploy the BizTalk Project

So far, the development of the BizTalk project has basically been completed. You can generate a project file to see if there is any error message. Next, deploy the BizTalk project to the BizTalk host. Because the BizTalk Assembly needs to be installed in GAC (global application cache. Therefore, you need to add a signature to the Assembly. In the naming window of Visual Studio, enter the following command:

Sn-k e: \ projects \ btshelloworld2 \ btshelloworld2.snk

After the application signature is created. On the properties page of the BizTalk applicationAssembly key file.

Fill in the Application name in the build window of the Configuration Attribute and verify whether the server is a local machine. Note This When copying programs from other machines.

Develop good habits. Configure the solution and select the program deployment. This is helpful for the development of BizTalk. When Visual Studio is deployed through the solution, the relationship between programs is determined.

 

 

Right-click solution after configuration. SelectDeployment SolutionYou can.

6. Configure and start the application.

After the application is deployed, you can view the corresponding program on the BizTalk console. Right-click the program and selectConfiguration. Configure programs on the application configuration pageHost,Receiving PortAndSending Port.

 

6.1 create a receiving port

The receiving port is a little more complex. So we will create a receiving port as an example. The sending port can be created by referring to the method of the receiving port. First, on the application configuration pageReceiving physical portSelectNew receiving port. In the displayed dialog box, enter the name of the receiving port. SelectReceiving location. InReceiving locationEnter a name in the dialog box. Select the custom name of the receiving pipeline (select the custom name of the sending pipeline for the sending port)File. ClickConfig. InFileIn the transfer dialog box, enterReceiving location.

 

The Configuration Wizard displays the completed part. After the configuration is complete, click OK.

 

6.2 start the application

Right-click the application and click Start. In the displayed dialog box, click Start again.

7. Test Procedure

Biztalk has been deployed. The next step is to test the program. The test program requires source data, which is not manually created. We can use the instance generation function of the schema editor to generate source data. Right-click sourceschema and chooseGenerate instance

 

In the output window of Visual Studio, you can view the address of the generated file, open the file, and change the corresponding content. (If You Want To specify the path of the output file. Right-click sourceschema and select the path of the file in the output file in the dialog box .)

<ns0:Root xmlns:ns0="http://BTSHelloWorld2.SourceSchema"><para1>Hello </para1><para2> World!</para2></ns0:Root>

In the output location of the configuration, we can see the corresponding output file.

 

8. Summary

So far, we have completed the development of the entire program. This sample covers the development of schema, MAP, pipeline, and orchestration. Deployment and configuration of BizTalk applications. We hope this will give you a rough understanding of BizTalk development.

Biztalk series (7) Hello World2

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.