BizTalk Server 2006 - Karlstad University · 2009-05-15 · BizTalk Server 2006 Administration...

66
MGö, MBl, JEd C#.NET VT09 1 BizTalk Server 2006 VT 09

Transcript of BizTalk Server 2006 - Karlstad University · 2009-05-15 · BizTalk Server 2006 Administration...

MGö, MBl, JEd C#.NET VT09 1

BizTalk Server 2006

VT 09

MGö, MBl, JEd C#.NET VT09 2

Literature

• These slides are based on information in the book:– Foundations of BizTalk Server 2006 By Daniel

Woolston

MGö, MBl, JEd C#.NET VT09 3

BizTalk Server 2006 Administration Console

• The center point of all activity– Through the main page you can access links that

drive other content– Application based

• In this version you have the concept of BizTalk as an application. In earlier versions it was more of a pool of ports, orchestrations, pipelines,..

• A default application has been created called ”Application 1” – It will have a folder for each of the application pieces– In earlier versions you had to use naming conventions to

organize the integration tools• This application view is only available through the

Administration Console– You also have easy access to the Event Viewer

MGö, MBl, JEd C#.NET VT09 4

MGö, MBl, JEd C#.NET VT09 5

BizTalk Server 2006Configuration

• Allows you to modify the current configuration.– Click Unconfigure before reconfiguring

MGö, MBl, JEd C#.NET VT09 6

MGö, MBl, JEd C#.NET VT09 7

BAM Portal Web Site

• Allows you to see the running processes at your server and their status– For example: Product waiting for approval

before shipping on..

MGö, MBl, JEd C#.NET VT09 8

Web Services Publishing Wizard

• Parts of the BizTalk Server structure can be published as web services– Orchestrations, schemas

MGö, MBl, JEd C#.NET VT09 9

Visual Studio 2005 Tools

MGö, MBl, JEd C#.NET VT09 10

Available Artifacts in Visual Studio

MGö, MBl, JEd C#.NET VT09 11

BizTalk Explorer

• View -> BizTalk Explorer

• Handy for quick lookups

MGö, MBl, JEd C#.NET VT09 12

More on Messaging

• If you can save it, send it, or serialiaze it– It can be a BizTalk message– BizTalk does not only accept XML-files

– But among the most common ones are XML-files and flat files

MGö, MBl, JEd C#.NET VT09 13

Message-Delivery Patterns

• Different ways the messages are consumed and produced

– Scatter-gather– Request-reply– Publish-subscribe

MGö, MBl, JEd C#.NET VT09 14

Scatter-gather

• Scenario: Your company is interested in the lowest price for a product among your vendors– A bid request is sent to BizTalk which in turn scatters

the request to the connected vendors. – BizTalk then wait and gathers the messages from the

vendors that responded– BizTalk then processes the messages and pass them

back to the business user who ordered the comparison

MGö, MBl, JEd C#.NET VT09 15

Request-reply

• Scenario: Communication with an organization with strict rules. – When sending a message to our BizTalk

server it will want to have an immediate reply indicating that we have received the message

• ACK/NACK

MGö, MBl, JEd C#.NET VT09 16

Publish-subscribe

• Scenario: You want to communicate updated information to vendors that are interested– You let BizTalk publish the message out to a

catalogue location that your vendors has access rights to

– The vendors that are interested has a process that monitors, subscribes to, the file folder

– When a message appear in the file folder, interested vendors pick it up

MGö, MBl, JEd C#.NET VT09 17

Message-Processing Patterns

• These patterns are aimed towards how BizTalk processes the messages that has arrived

– Aggregator– First in/First out– Splitter

MGö, MBl, JEd C#.NET VT09 18

Aggregator

• Aggregator: Collect sequence of incoming messages and consolidate into single message

– (Recipient-List “scatters”; Aggregator “gathers”)

MGö, MBl, JEd C#.NET VT09 19

First in / First out

• FIFO – messages are processed in the order they arrive– Not done by default, need to configure BizTalk

do FIFO

MGö, MBl, JEd C#.NET VT09 20

Splitter

• Pattern that splits one message into several, individual messages that are processed separatly

MGö, MBl, JEd C#.NET VT09 21

Creating your first Schemas

• In Visual Studio:1. Create a new Project

2. Choose to create an empty BizTalk Server Project and name it

3. In Solution Explorer, right-click on the project name and select Add->New Item

4. Select Schema Files then Schema in the right panel

5. Name the schema Note.xsd

MGö, MBl, JEd C#.NET VT09 22

MGö, MBl, JEd C#.NET VT09 23

MGö, MBl, JEd C#.NET VT09 24

Root node

• By default Visual Studio will add a Root node for you

• This node will need to be renamed to match our data– Right-click on the Root

node and select Rename

– Modify so that the root node is named Note

MGö, MBl, JEd C#.NET VT09 25

Adding Nodes

• Right-click on the root node (Note) and select Insert Schema Node

• We are going to add a Child Field Element, so choose that

• Rename and type in To• Do the same for the fields

From, Date, Heading and Body

MGö, MBl, JEd C#.NET VT09 26

MGö, MBl, JEd C#.NET VT09 27

Setting the Data Type

• By default all fields will have the data type string

• For the fields that we have added so far, except for Date– Right-click on Date

and choose/go to the properties pane

– Choose Data Type and xs:date

MGö, MBl, JEd C#.NET VT09 28

Final Result: Note.xsd

MGö, MBl, JEd C#.NET VT09 29

Creating a Sample XML File

• Good for testing purposes!– Right-click on Note.xsd in the Solution Explorer and select Properties– Set the output Instance Filename and where you want to place it, name

it SampleNote.xml

MGö, MBl, JEd C#.NET VT09 30

Creating a Sample XML File cont’d

• Right-click on Note.xsd again and select Generate Instance

• Your sample file will be generated and found in the catalogue you had chosen

• If you open the Output window you will see a link that leads to the xml-file

MGö, MBl, JEd C#.NET VT09 31

Final Result: SampleNote.xml

MGö, MBl, JEd C#.NET VT09 32

Generating a Schema from a XML File

• Let’s say you have an xml-file, and then want to generate a schema from that file..

<?xml version="1.0"?> <mail> <recipient>davb07</recipient> <from>Mari</from> <sent><year>2007</year><month>07</month><day>07</day></sent><subject>Reminder</subject> <body>Labs to be handed in no later than.. </body> </mail>

MGö, MBl, JEd C#.NET VT09 33

How to generate an XML Schema

• Right-click on your project and select Add -> Add Generated Items• Select Generate Schemas in both panels

MGö, MBl, JEd C#.NET VT09 34

How to generate a XML schema cont’d

• Click Add • Select Well-formed

XML

• Browse to find the file, in our case MailFromMari.xml

• Click OK and your schema will be generated

• You might have to change the data types

MGö, MBl, JEd C#.NET VT09 35

MGö, MBl, JEd C#.NET VT09 36

Generating a Flat File Schema

• Let’s say that instead of having a Note.xml file we have a noteFlatFile.txt that containts this:

Jane,Dave,2007-06-12,Hello,LalalaMia,Malin,2007-07-07,Reminder,TralalaOlle,Joppe,2007-01-01,Save,Joppe dead or alive

MGö, MBl, JEd C#.NET VT09 37

The Flat File Schema Wizard

• Right-click on the project name in the Solution Explorer and select Add->Add New Item

• Select Schema Files and then Flat File Schema Wizard

• Name the schema file noteFlatFile.xsd

• Click Add to continue

MGö, MBl, JEd C#.NET VT09 38

The Flat File Schema Information

• Click next when the welcome box appears• The Flat File Schema Information box appears. Locate the txt-file and fill in

as below

MGö, MBl, JEd C#.NET VT09 39

Selecting Document Data

• Select the text you want to use to create the schema• Click Next

MGö, MBl, JEd C#.NET VT09 40

Selecting Record Format

• Select By delimiter symbol

MGö, MBl, JEd C#.NET VT09 41

Specify properties of the delimited record

• Specify the delimiter used in the text file to separate rows. We used a carriage return/line feed (CR/LF) to end each row

MGö, MBl, JEd C#.NET VT09 42

Specify properties of the child elements

• On the first row: Tell the wizard that we are dealing with repeating records• Since we are interested in building a schema from the file, the rest of the

rows does not matter. Choose Ignore on the rest.

MGö, MBl, JEd C#.NET VT09 43

Delimiting the rest of the nodes

MGö, MBl, JEd C#.NET VT09 44

Selecting Document Data again

• But this time we are only interested in the first line, since we are interested in building up the schema structure, so highlight that.

MGö, MBl, JEd C#.NET VT09 45

Specifying how the record data is formatted

• The record data is separated by a delimiter symbol, so choose that

MGö, MBl, JEd C#.NET VT09 46

Selecting delimiter symbol

MGö, MBl, JEd C#.NET VT09 47

Name and declare data type for each child element - before

MGö, MBl, JEd C#.NET VT09 48

Name and declare data type for each child element - after

MGö, MBl, JEd C#.NET VT09 49

Final Schema View

MGö, MBl, JEd C#.NET VT09 50

MGö, MBl, JEd C#.NET VT09 51

Schema Mapping

• Often the schema that your own application uses does not match the schema your business partners use

• BizTalk has ha Mapper for this purpose

Source file schema

Destination file schema

Destination data file

MGö, MBl, JEd C#.NET VT09 52

Creating the Schema Map

• Right-click on the projects name and choose Add -> Add New Item

• Select Map Files and in the right panel Map

• Name your map file TestMap.btm

MGö, MBl, JEd C#.NET VT09 53

MGö, MBl, JEd C#.NET VT09 54

MGö, MBl, JEd C#.NET VT09 55

The BizTalk Mapper

• The three panels are– Left: Source Schema– Center: Manpulation of how the mappings are

done. These manipulations are done through what BizTalk call Functoids

– Right: Destination Schema

MGö, MBl, JEd C#.NET VT09 56

Adding Schemas

• We are going to use Mail.xsd as the Source schema, and Note.xsd as the Destination schema– Click on Open Source Schema and locate

Mail.xsd

– Click on Open Destination Schema and locate Note.xsd

MGö, MBl, JEd C#.NET VT09 57

MGö, MBl, JEd C#.NET VT09 58

Associating Schema Elements

• Now highlight an element and simply drag to the appropriate element in the destination schema

MGö, MBl, JEd C#.NET VT09 59

BizTalk Functoids

• So what is left? Correct, we still have to map the date element

• BizTalk offers a lot of predefined functoids for that purpose– Open the Toolbox for

the Mapper

MGö, MBl, JEd C#.NET VT09 60

Mapping the Date Element

• For this mapping we are going to use the String Concatenate functoid– Locate and highlight the functoid– Drag it onto the center pane of the Mapper– From the Source Schema pane drag year,

month and day to the functoid– From the Destination Schema pane drag date

to the functoid

MGö, MBl, JEd C#.NET VT09 61

MGö, MBl, JEd C#.NET VT09 62

Configure the Functoid

• Right-click on the functoid and choose Configure Functoid Inputs

MGö, MBl, JEd C#.NET VT09 63

Adding Extra Parameters

• Now, we want to add a delimiter, -, between the elements

• Click on the button marked by an arrow (the tooltip will also say ”Insert New Parameter”)

MGö, MBl, JEd C#.NET VT09 64

Adding Extra Parameters

• Double-click on the icon for the new parameter to change its value.

• Add ’-’

MGö, MBl, JEd C#.NET VT09 65

Testing the Map

• Right-click on the map file in the Solution Explorer and select Properties

• In TestMap Input Instance– Locate the file we created before: MailFromMari.xml– Click OK

• Right-click on the map file again and this time choose Test Map

• You will see the result in the Output pane– Click and follow the output file that has been created

for you

MGö, MBl, JEd C#.NET VT09 66

The Test Results