Sie sind auf Seite 1von 16

Microsoft Virtual Labs

Working with Pipelines


Working with Pipelines

Table of Contents

Exercise 1 Create Receive Port and a Receive Location ........................................................... 1


Exercise 2 Create Send Ports and Define Messages Filters ...........................................................................................3
Exercise 3 Start the Send Ports and Test the Configuration ..........................................................................................4
Exercise 4 Configuring BizTalk Host and Group Security Settings ..............................................................................5
Exercise 5 Creating a Custom Send Pipeline .................................................................................................................6
Exercise 6 Creating a Custom Send Pipeline .................................................................................................................7
Exercise 7 Modify Send and Receive Ports ...................................................................................................................8
Exercise 8 Testing the Send Pipeline Solution ..............................................................................................................9
Exercise 9 Creating a Custom Receive Pipeline .......................................................................................................... 10
Exercise 10 Building and Deployment the Receive Pipeline Project .......................................................................... 11
Working with Pipelines

Working with Pipelines


Objectives
After completing this lab, you will be able to:

• Create a receive port and a receive location.


• Create send ports and define message filters.
• Start the send ports, enable the receive location, and test the
configuration.
• Configure BizTalk group and host security settings.
• Create a custom send pipeline.
• Modify a send port to use a custom pipeline.
• Create a custom receive pipeline.
• Build and test the pipeline solution.

Scenario At times, you may receive certain types of messages that do not require any
detailed processing. Message routing provides a solution for forwarding
messages to a specific send port, based solely on the contents of the message.
Northwind Traders wants to immediately route customer orders to its supplier,
Fabrikam, when the order amount is equal to or less than $500. Orders greater
than $500 require additional approval, and should be routed internally for
additional processing.
Northwind Traders also requires that all business-to-business (B2B) messages
exchanged with trading partners be secure. In this lab, you will configure two
custom pipelines. First you will configure a send pipeline that includes the
S/MIME decoder component for encrypting all outbound messages. Next you
will configure a receive pipeline to decrypt all inbound messages from trading
partners.

User Name: Administrator


Password: pass@word1

Computers used in this


Lab:
BizTalkServer2006R2VPC

Page 1 of 14
Working with Pipelines

Estimated Time to
Complete This Lab 60 Minutes
In this lab, you will learn how to create both receive locations and send ports.
You will also learn how to use message routing to create a subscription for a send
port. In this example, you create a filter that checks the quantity and either
forwards the message to one send port if the value is equal to or less than 500, or
forwards it to another send port if the value is greater than 500.

Receive
Receive Port
Port
11 (rprtReceive)
(rprtReceive)
Receive
Receive Location
Location
(rlocReceiveFILE)
(rlocReceiveFILE)

MessageBox
Map
Map
22
NWCustomerOrder To Subscriptions
FKSupplierPO.btm

33 44
Order > 500 Order <= 500

Send
Send Port
Port Send
Send Port
Port
(sprtPONeedsApproval)
(sprtPONeedsApproval) (sprtPOSendOrderFILE)
(sprtPOSendOrderFILE)
Filter: Filter:
>500 Bind/Enlist <=500

Page 2 of 14
Working with Pipelines

Exercise 1
Create Receive Port and a Receive Location
Scenario
In this exercise, you will open and modify an existing solution and create a receive port and a receive location for
incoming messages
Tasks Detailed Steps
1. Configure the a. On the Windows Desktop, double-click the SetupLab.bat shortcut.
starting lab b. From the Lab Setup Menu, type 4.
environment.
2. Open an existing a. In Windows Explorer, open
solution. C:\Labs\Work\Lab04\NWBusinessSolution\NWBusinessSolution.sln.
Performing this step
opens a predefined Note: A predefined project opens in Solution Explorer.
project that contains
schemas (.xsd) and
a map file (.btm).
3. Build and deploy a. In Solution Explorer, right-click NWMessaging, and then click Build.
the project. b. Wait until you see Build succeeded in the lower left corner.
c. Right-click NWMessaging, and then click Deploy.
Note: Performing this step installs the classes contained in the assemblies in the
BizTalk Database and adds the assembly to the GAC
If the BUILD does not succeed, do the following steps:-
i. In solution explorer, expand the references folder and right click FKMessaging and
click REMOVE
ii. Right click References and click Add Reference
iii. Click the Browse Tab in the Add Reference dialog and browse to
C:\labs\SupportingArtifacts\FKMessaging\bin\development. Select FKMessaging.dll
and click ADD and OK
You will see a number of warnings in the Error List, these can be ignored. Right click
the NWMessaging node in solution explorer and click Build, your project should
successfully build
Right-click NWMessaging and then click Deploy..
4. Create a receive a. From the Start menu, point to All Programs, then point to Microsoft BizTalk
port. Server 2006, and then click BizTalk Server Administration.
Performing this step b. In BizTalk Administration Console, expand BizTalk Server 2006
creates a receive port for Administration > BizTalk Group > Applications, and then expand BizTalk
incoming messages and Application 1.
instructs BizTalk Server c. Right-click Receive Ports, point to New, and then click One-way Receive Port.
to use the
d. In the Receive Port Properties dialog box, configure the port with the following
NWCustomerOrder_To_
properties (click for drop-down on Inbound Maps):
FKSupplierPO map to
transform any message
where the message’s Parameter Value
schema matches the Name rprtReceive
source schema of the map.
Inbound Maps CustomerOrder [NWMessaging…
Source Document

Page 1 of 14
Working with Pipelines
Tasks Detailed Steps

e. Click OK to save changes.


5. Create a receive a. Right-click Receive Locations, point to New, and then click One-way Receive
location. Location.
b. In the Select a Receive Port dialog box, select rptReceive, and then click OK.
Configuring the c. Use the following properties for the receive location (to access Receive Folder
receive location and File Mask, click Configure):
provides the
physical address Parameter Value
and transport Name rlocReceiveFILE
information for
Transport Type FILE
BizTalk Server to
process inbound Receive Folder C:\Labs\Work\FileDrop\Messaging\
messages. Receive
File Mask *.xml
Receive Handler BizTalkServerApplication
As an alternative to
Receive Pipeline XML Receive
typing in the folder
path, you can
browse for the d. Click OK to save changes.
folder in Windows
Explorer, and then
copy and paste the
Address URI path.

Page 2 of 14
Working with Pipelines

Exercise 2
Create Send Ports and Define Messages Filters
Scenario
In this exercise, you will create two send ports and define a filter for routing messages to a specific send port,
based on the message contents. Outgoing customer orders with a total amount equal to or less than $500 will be
sent to a send port that forwards the message immediately to the supplier. Customer orders with amounts greater
than $500 require internal approval and will be sent to a different send port for further processing.

Tasks Detailed Steps


1. Create the first Note: Performing this step creates a file folder location to send the message to if the
send port. amount is less than or equal to 500.
a. In BizTalk Administration Console, right-click Send Ports, then point to New,
and then click Static One-way Send Port.
Performing this step b. Create a static one-way port by using the following information (to access
creates a file folder Destination Folder and File Name, click Configure):
location to send the
message to if the Parameter Value
amount is less than or Name sprtPOSendOrderFILE
equal to 500.
Transport Type FILE
Destination Folder C:\Labs\Work\FileDrop\Messaging\S
endOrder
File Name PurchaseOrder%MessageID%.xml
Send Pipeline XML Transmit
Filter NWMessaging.PropertySchema.Tota
lOrderAmount <=500
c. Click OK to save changes.
2. Create the second a. Right-click Send Ports, then point to New, and then click Static One-way Send
send port. Port.
b. Create a static one-way port by using the following information (to access
Destination Folder and File Name, press Configure):
Parameter Value
Name sprtPONeedsApprovalFILE
Transport Type FILE
Destination Folder C:\Labs\Work\FileDrop\Messaging\Need
sApproval
File Name PurchaseOrder%MessageID%.xml
Send Pipeline XML Transmit
Filter NWMessaging.PropertySchema.TotalOr
derAmount > 500

c. Click OK to save changes.

Page 3 of 14
Working with Pipelines

Exercise 3
Start the Send Ports and Test the Configuration
Scenario
In this exercise, you will start the send ports, enable the receive locations, and then test the scenario.

Tasks Detailed Steps


1. Start the BizTalk a. In BizTalk Administration Console, right-click BizTalk Application 1, and
Server application. then click Start.
Starting the application b. In the Start ‘BizTalk Application 1’ Application dialog box, click Start.
will start all send ports and
enable all receive
locations, as well as start
orchestrations.
2. Restart the host a. In BizTalk Server 2006 Administration Console, expand Platform Settings,
instance. and then click Host Instances.
The host instance must be b. Right-click BizTalkServerApplication, and then click Restart.
restarted anytime new
applications are deployed.

3. Test the scenario. a. In Windows Explorer, browse to C:\Labs\Work\FileDrop\Messaging, and


then use Notepad to open and view CustomerOrder1.xml.
The receive port Note: Verify that the TotalOrderAmount is less than 500.
might take a b. Close Notepad.
minute to activate
c. Copy CustomerOrder1.xml and paste it to
and process the
C:\Labs\Work\FileDrop\Messaging\Receive.
first document the
first time you Note: Do not move the file, because BizTalk Server processes it and then removes it
enable the location. from the …\Receive folder.
d. Browse to C:\Labs\Work\FileDrop\Messaging\SendOrder and verify that the
To see the total order was routed correctly.
order amount, you Note: Because the amount is less than 500, the order is dropped into the …\SendOrder
may want to open folder.
the e. In Windows Explorer, browse to C:\Labs\Work\ FileDrop\Messaging and use
CustomerOrder1.x Notepad to open and view CustomerOrder2xml.
ml and
Note: Verify that the TotalOrderAmount is greater than 500.
CustomerOrder2.x
ml files before f. Close Notepad.
moving them. g. Copy CustomerOrder2.xml and paste it to
C:\Labs\Work\FileDrop\Messaging\Receive.
h. Browse to C:\Labs\Work\FileDrop\Messaging\NeedsApproval to verify that
the order was routed correctly.
Note: Because the amount is greater than 500, the order is dropped into the
...\NeedsApproval folder.

Page 4 of 14
Working with Pipelines

Exercise 4
Configuring BizTalk Host and Group Security Settings
Scenario
In this exercise, you will modify the BizTalk group and host properties to associate a signing certificate for
decrypting inbound messages and encrypting outbound messages. The required certificate already exists in the
certificate store.

Tasks Detailed Steps


1. Associate a a. In the BizTalk Administration Console, expand Microsoft BizTalk Server
certificate with a 2006 Administration > BizTalk Group > Platform Settings, and then click
BizTalk host. Hosts.
b. Right-click BizTalkServerApplication, and then click Properties.
The thumbprint c. In the Host Properties dialog box, click Certificates, and then click the Browse
specifies which button.
certificate (your
private key) to use d. In the Select Certificate dialog box, select the certificate with Fabrikam as the
when decrypting friendly name, and then click OK.
inbound messages. e. Click OK to save changes.
2. Associate a signing a. In the left pane, expand Applications.
certificate with a b. Right-click BizTalk Application 1, and then click Stop.
BizTalk group.
c. In the Stop ‘BizTalk Application 1’ Application dialog box, click Stop
The thumbprint d. Right-click BizTalk Application 1, and then click Start.
specifies which e. In the Start ‘BizTalk Application 1’ Application dialog box, click Start
certificate (your f. Close the BizTalk Server 2006 Administration Console.
private key) to use
when signing
outbound messages.
3. Restart the host. a. In the left pane, expand Applications.
b. Right-click BizTalk Application 1, and then click Stop.
c. In the Stop ‘BizTalk Application 1’ Application dialog box, click Stop
d. Right-click BizTalk Application 1, and then click Start.
e. In the Start ‘BizTalk Application 1’ Application dialog box, click Start
f. Close the BizTalk Server 2006 Administration Console.

Page 5 of 14
Working with Pipelines

Exercise 5
Creating a Custom Send Pipeline
Scenario
In this exercise, you will open the existing project and create a new pipeline. You will then add and configure the
XML Assembler and MIME/SMIME pipeline components for this pipeline.

Tasks Detailed Steps


1. Open the existing a. Open the solution:
solution. C:\Labs\Work\Lab04\NWBusinessSolution\NWBusinessSolution.sln.

This opens a
preconfigured
solution and
associated projects.
2. Create a new a. In Solution Explorer, right-click the NWMessaging project, point to Add, and
pipeline. then click New Item.
b. In the Add New Item dialog box, click Pipeline Files in the Categories pane,
This creates a new and then in the Templates pane, click Send Pipeline.
blank pipeline with a c. In the Name box, type SendEncryptedPurchaseOrder.btp as the pipeline
default set of
name.
components.
d. Click Add to open the new pipeline in Pipeline Designer.

3. Configure the a. If the Toolbox is not docked on the left side, on the View menu, click Toolbox.
pipeline. b. From the Toolbox, drag the XML Assembler component to the Drop Here box
under the Assemble stage in the Pipeline Designer.
This sets the c. Drag the MIME/SMIME encoder component to the Drop Here box under the
properties to enable Encode stage.
encryption of the
d. Configure the MIME/SMIME encoder component properties as follows:
outbound document.
Property Value
Check Revocation List False
Content transfer encoding Base64
Enable encryption True
Encryption algorithm DES3
Send body part as True
attachment
Signature type NoSign

Page 6 of 14
Working with Pipelines

Exercise 6
Creating a Custom Send Pipeline
Scenario
In this exercise, you will build and deploy the pipeline project.

Tasks Detailed Steps


1. Build the pipeline a. In Solution Explorer, right-click NWMessaging, and then click Build.
project and deploy b. Wait until you see Build succeeded in the lower left corner.
the assembly.
c. Right-click NWMessaging, and then click Deploy.
Note: View the Output window to verify that the project successfully compiled and
deployed.
2. View the deployed a. In BizTalk Explorer, right-click BizTalk Configuration Databases, and then
assembly. click Refresh.
Note: If the BizTalk Explorer is not docked on the left side, on the View menu, click
BizTalk Explorer.
b. Expand Assemblies to verify that the NWMessaging assembly appears as a
deployed assembly.

3. Restart the host a. In BizTalk Server 2006 Administration Console, expand BizTalk Server 2006
instance. > BizTalk Froup > Platform Settings, and then click Host Instances.
The host instance must b. Right-click BizTalkServerApplication, and then click Restart.
be restarted anytime
new applications are
deployed.

Page 7 of 14
Working with Pipelines

Exercise 7
Modify Send and Receive Ports
Scenario
In this exercise, you will modify the send port properties to associate the certificate and the send pipeline with the
send order port. Then you will start the port.

Tasks Detailed Steps


1. Modify the send a. In BizTalk Explorer, expand Send Ports, right-click sprtPOSendOrderFILE,
port properties. and then click Edit.
b. Modify the Port Properties by using the following information:
This associates the
certificate and the Parameter Value
send custom pipeline Send… Certificate …”Fabrikam..."
with this send port. Name
Send… Send Pipeline NWMessaging.SendEncryptedPurchaseOrder

c. Click OK.
2. Start the send port. a. Right-click sprtPOSendOrderFILE, and then click Start (if it isn’t already
started).
b. Right-click sprtPONeedsApprovalFILE, and then click Start (if it isn’t
already started).
3. Modify the receive a. Expand Receive Ports, right-click rprtReceive, and then click Edit.
port. b. Modify the receive port by using the following information (if not already
selected):
This modifies the
receive port to use a
map. Parameter Value
Inbound NWMessaging.NWCustomerOrder_To_FKSu
Maps pplierPO…

c. Click OK.
4. Enable the receive a. Expand rprtReceive, expand Receive Locations, right-click rlocReceiveFILE,
location. and then click Enable (if not already enabled).

Page 8 of 14
Working with Pipelines

Exercise 8
Testing the Send Pipeline Solution
Scenario
In this exercise, you will test your pipeline by viewing the document that has been encrypted after being
processed.

Tasks Detailed Steps


1. Test the scenario. a. In Windows Explorer, browse to C:\Labs\Work\ FileDrop\Messaging, and
then open CustomerOrder1.xml in Notepad.
Because the amount is Note: Notice that the file is not encrypted.
less than 500, the b. In Windows Explorer, copy both
CustomerOrder1.xml CustomerOrder1.xml and CustomerOrder2.xml to
message is processed
C:\Labs\Work\FileDrop\Messaging\Receive.
by the subscribing
SendOrder port, c. Browse to C:\Labs\Work\FileDrop\Messaging\SendOrder, and open the new
which uses the file in Notepad to verify that the message has been encrypted.
pipeline to encrypt the d. Browse to C:\Labs\Work\FileDrop\Messaging\NeedsApproval, and verify
message. that the new message has not been encrypted.

Page 9 of 14
Working with Pipelines

Exercise 9
Creating a Custom Receive Pipeline
Scenario
In this exercise, you will open the existing project and create a new pipeline. You will then add and configure the
XML Assembler and MIME/SMIME pipeline components for this pipeline.

Tasks Detailed Steps


1. Reset the previous a. In BizTalk Explorer, expand Send Ports, right-click sprtPOSendOrderFILE,
project. and then click Unenlist.
b. Right-click sprtPOSendOrderFILE, and then click Edit.
To change c. In the Static One-Way Send Port Properties dialog box, configure the
NWMessaging, you following settings, then click OK:
must undeploy and
then redeploy it. To Parameter Value
undeploy, you must
Send… Certificate Name <None>
remove all references
(in any port) to the Send… Send Pipeline …DefaultPipelines.XMLTransmit…
objects contained in
the assembly you d. Expand Receive Ports, right-click rprtReceive, and then click Edit.
want to undeploy. To e. Select Inbound Maps, and then delete the
remove references NWCustomerOrder_To_FKSupplierPO map and then click OK
you must unenlist the
port. f. Expand Assemblies, right-click NWMessaging, and then click Undeploy.
g. Click Yes when prompted to undeploy the assembly.
2. Create a new a. In Solution Explorer, right-click the NWMessaging project, point to Add, and
pipeline. then click New Item.
b. In the Add New Item dialog box, in the Categories pane, click Pipeline Files,
This creates a new and then in the Templates pane, click Receive Pipeline.
blank pipeline that has c. In the Name box, type ReceiveEncryptedPurchaseOrder.btp to name the
a default set of
pipeline.
components.
d. Click Add to open the new pipeline in Pipeline Designer.
Note: The new pipeline appears in Pipeline Designer.
3. Add the a. From the Toolbox, drag the XML Disassembler component to the Drop Here
XML Disassembler box under the Disassemble stage in the Pipeline Designer.
component to the b. Drag the MIME/SMIME decoder component to the Drop Here box under the
pipeline. Decode stage.
c. Configure the MIME/SMIME decoder component properties as follows:
This sets properties of
the pipeline to enable
Property Value
decryption of inbound
messages in this Allow non MIME Message False
pipeline. Check Revocation List False
4. Add the XML a. Drag an Xml Validator component to the Drop Here box under the Validate
Validator comp- stage.
onent to the pipeline. b. Modify the properties for the XML Validator component by using the
This checks the following information:
inbound message to
ensure it is valid per Property Value
the CustomerOrder Document Schemas NWMessaging.CustomerOrder
schema.

Page 10 of 14
Working with Pipelines

Exercise 10
Building and Deployment the Receive Pipeline Project
Scenario
In this exercise, you will build and deploy the pipeline project. You will then test your receive pipeline by
viewing the document that has been decrypted after being processed.

Tasks Detailed Steps


1. Build the pipeline a. In Solution Explorer, right-click NWMessaging, and then click Build.
project and deploy b. Wait until you see Build succeeded in the lower left corner.
the assembly.
c. Right-click NWMessaging, and then click Deploy.
Note: View the Output window to verify that the project successfully compiled and
deployed.
2. Restart the host a. In BizTalk Server 2006 Administration Console, expand Platform Settings,
instance. and then click Host Instances.
The host instance b. Right-click BizTalkServerApplication, and then click Restart.
must be restarted
anytime new
applications are
deployed.
3. Modify the receive a. In BizTalk Explorer, right-click BizTalk Configuration Databases, and then
port. click Refresh.
b. Expand Receive Ports, right-click rprtReceive, and then click Edit.
This modifies the
c. Modify the receive port by using the following information:
receive port to use a
map. Parameter Value
Inbound NWMessaging.NWCustomerOrder_To_FKSu
Maps pplierPO…
d. Click OK, then expand rprtReceive > Receive Locations, then right-click
rlocReceiveFile, and then click Edit.

Parameter Value
Receive Pipeline NWMessaging.ReceiveEncryptedPurchaseOrder…
e. Modify the receive location by using the following information, then click OK.
4. Enlist and start the a. Expand Send Ports.
send ports. b. Right-click sprtPOSendOrderFILE, and then click Start.
5. Test the scenario.
a. Restart the BizTalk Host process (so it can pick up on the changes you’ve
Here the inbound made to the assemblies). You can do this in the BizTalk Administration
message is encrypted Console, under Platform Settings – Host Instances.
and BizTalk Server
b. Use Windows Explorer to browse to C:\Labs\Work\FileDrop\Messaging, and
decrypts it.
then open EncryptedCustomerOrder.xml by using Notepad.
If you cannot find the Note: Notice that the file is encrypted.
output file, check the c. Use Windows Explorer to copy and paste
Event Log for EncryptedCustomerOrder.xml to
possible errors. C:\Labs\Work\FileDrop\Messaging\Receive.
d. Browse to C:\Labs\Work\FileDrop\Messaging\SendOrder, and use Notepad
to verify that the most recent message has been decrypted.
e. Close Visual Studio.

Page 11 of 14
Working with Pipelines

Page 12 of 14

Das könnte Ihnen auch gefallen