BizTalk Server 2010 ESB Training Kit

November 5, 2012 Leave a comment

This training kit contains a complete set of materials that will enable you to learn about the ESB Toolkit in BizTalk Server 2010. This kit includes lab manuals, PowerPoint presentations and videos, all designed to help you learn about the ESB Toolkit. There is also an option to download a Virtual Machine that is ready for you to use with the training kit.

Click here to Download

Advertisements

Implementation of Routing slip pattern using ESB Toolkit 2.1 and BizTalk Server 2010

June 12, 2012 1 comment

Routing slip pattern describes a scenario where we route a message consecutively through a series of processing steps when the sequence of steps is not known at design-time and may vary for each message.

Business Case: XML messages pertaining to Employee schema are picked by BizTalk from a specified file location and routed through a series of processing steps (Itinerary) based on the value of department. For example if the department is ‘Admin’ then ‘ForAdmin’ itinerary will be selected and if ‘HR’ then ‘ForHR’ itinerary will be selected.

Solution Walkthrough:
This solution consists of following artifacts:
• Itineraries( ForHR.itinerary and ForAdmin.itinerary) – Series of processing steps defined for HR and Admin employees respectively.
• Business rule policy (SelectItineraryBasedOnDept) – Used to select the correct itinerary based on the value of department.
• XML Schema( Employee.xsd)

Steps to create and test the solution
1. Open BizTalk Administrator console and create an application named “ESBSamples”. add a reference of the application “Microsoft.Practices.ESB” to the ESBSamples project.
Note:Microsoft.Practices.ESB is the default application for ESB related artifacts which get automatically created during the configuration of ESB Toolkit 2.1
2. Right click on Send ports under the application ESBSamples and Create a new dynamic one way send port named “DynamicSendToOutput”. Create the following filters as shown below:
i
3. Create a Receive port ESBSample.OnRamp.Itinerary and a Receive location named ESBSample.OnRamp.Itinerary.FILE and configure this as:
URI: C:\C#\Input\*.xml
Receive Pipeline: ItinerarySelectReceiveXml having ItineraryFactKey = Resolver.Itinerary
ResolverConnectionString = BRI:\\policy=SelectItineraryBasedOnDept;useMsg=true;recognizeMessageFormat=true;

Here SelectItineraryBasedOnDept is the name of the Business Rule Policy which we will be creating from step- (8)
2
4. Now open visual studio 2010, create a blank solution named “Abhijit.ESBSamples”.
5. Add an Empty BizTalk Server project named “Abhijit.ESBSamples.Demo2.Schemas” and a BizTalk ESB Itinerary Designer named “Abhijit.ESBSamples.Demo2.Itinerary”.
3
6. Right click on the schema project and add a schema named Employee.xsd having following fields as shown below in the image:
7
7. After signing the project deploy it to application named “ESBSamples” the one we have created in step-1.
Create the Business Rule Policy:
8. Now open Business Rule Composer and create a policy named “SelectItineraryBasedOnDept”
9. In the SelectItineraryBasedOnDept policy, right-click and Add New Rule. Name the rule to ”SelectAdminItinerary”.
10. In Facts Explorer, click the XML Schemas tab, right-click Schemas, and then click browse
to Employee.xsd under the folder C:\C#\Abhijit.ESBSamples\Abhijit.ESBSamples.Demo2.Schemas\ and open it.
11. In fact explorer, click on Employee.xsd and change the Document Type property to
Abhijit.ESBSamples.Demo2.Schemas.Employee.
12. In the Rule window, right-click Conditions, point to Predicates, and then click Equal.
13. From Facts Explorer, drag the Department element to the argument1 node under Conditions.
14. Click the argument2 node, and then type Admin.
15. From Facts Explorer, drag the Set Itinerary Name definition under the vocabulary ESB.Itinerary to Actions.
16. Click and then type ForAdmin to ‘‘.
8

Similarly add one more rule named “ForHR” having following Conditions and Actions
Rule: SelectHRItinerary
Conditions:
Abhijit.ESBSamples.Demo2.Schemas.Employee:/Employee/Department is equal to HR
Actions:
Set Itinerary Name to ForHR.
17. Publish and deploy the policy to RuleEngine database.

Create the “ForAdmin” Itinerary
18. Now switch to Visual studio solution and right click on Abhijit.ESBSamples.Demo2.Itinerary project and add an Itinerary named “ForAdmin.Itinerary
19. Design the Itinerary as below:
9
Here first shape is the On-Ramp(RcvAdminEmployee) and for the properties of this refer the below image.
10
Last shape is the Off-Ramp(SndAdminEmployeeMsg) and for the properties of this shape refer the below image.
11
Other two middle shapes are Itinerary service, one is for Messaging Extender(SendToFile) and other is for off-Ramp Extender(SetDestinationInfo).
For the properties of SendToFile shape, refer the below image
12

And for the properties of the Static Resolver used in the Itinerary service, refer the below image.
13

For the properties of off-Ramp Extender(SetDestinationInfo), refer the below image
14

20. Now Right-Click on the Itinerary designer and click on validate. You might get an error with description: A X509 Certificate is required in the model property ‘EncryptionCertificate’ to encrypt any sensitive property in the designer.

15
To get rid of this error you need to set the value of ‘Require Encryption Certificate’ to false.

21. Set the model exporter of the Itinerary as Database Itinerary Exporter and Itinerary status as Deployed.

16
22. Right-Click on Itinerary designer and click on Export model to store the Itinerary into EsbItineraryDb database.

Create the “ForHR” itinerary
23. Design the Itinerary as below image
17
Configuration properties for each shape is similar to “ForAdmin” itinerary. Only difference is in value of the ‘Transport Location’ of the Static Resolver used in ‘SendToFile’ itinerary service.
18
Right-Click on Itinerary designer and click on Export model to store the Itinerary into EsbItineraryDb database.

Test the solution:
• Download and extract the Source Code file to the C:\ drive; this process will create the necessary directories to test the application.
• From the BizTalk administrator console under the application “ESBSamples” enable the Receive location and start the send port. You might need to change the Receive location and send locations as per your environment.
• Now drop the files from the folder “C:\C#\Sample\“ into “C:\C#\Input\ “ folder. If everything configured properly then you will see one file each in the locations “C:\C#\Output\HR\” and “C:\C#\Output\Admin\” based on the value of the department field of the input messages.

Download the SourceCode:
To download the code please Click here

Note:Change the extension of the file from .doc to .zip and extract it into your C: drive.

Demo Application: Receiving EDI Messages in BizTalk 2009, Creating Trading partners and configuring acknowledgements for Parties.

January 12, 2012 Leave a comment

What it does?
This BizTalk application picks the EDI messages from the input directory, where EDIFACT Invoice documents sent from a trading partner named ‘CompanyA‘ is placed. BizTalk does the validation and resolve the party at the receive pipeline and publishes these messages to the Message box. A send port is configured to subscribe these messages and delivered to the output directory. At the same time BizTalk also sends the acknowledgement back to the sender.

How to deploy and test this application?
• Download the EDIDemo.doc file and renamed it to EDIDemo.zip.
• Extract the EDIDemo.zip file to the C:\ drive, this process will create the necessary directories to test the application.
• Go to Start->All programs->BizTalk Server 2009, click on BizTalk Server 2009 Administration console to open the BizTalk Administration console.

• Right click on Applications ->Import ->MSI file to start the import process.

• Select the ‘EDIDemo.msi’ file located at ‘C:\EDIDemo\Installer’ folder and click Next.

• Now follow the steps as shown in the below screen shots to complete the import process.

• Once the installation is completed. Right click on EDIDemo application and click on Start to start the application.

Test the application:
• Copy the sample file named ‘Invoice-CompanyA.txt’ located in ‘C:\EDIDemo\Sample’ and paste it in the folder ‘C:EDIDemo\Input’.
• Validate that the file was picked up from the Input folder by BizTalk. Check the Windows Event Viewer for any errors that may have occurred.
• If everything goes fine then you can see three invoice files in the ‘C:\EDIDemo\Output’ folder. And both of the acknowledgments were written out to the ‘C:\EDIDemo\Ack’ folder.

———————————————————————————————————

Important steps performed while developing this application
Creating Trading Partners:
In BizTalk 2009, trading partners are configured as parties. EDI documents are received in BizTalk are validated and their party is resolved at the receive pipeline (EDIReceive or AS2Receive). This resolution is based on the contextual information within the header of the incoming EDI message that matches with the settings that have been setup for the party.
Configuration of the home party at the Global EDI Properties:

Configuring Trading Partner (Company A) as Sender and Configuring acknowledgements:

When acknowledgement is configured for a party then that party also acts as a receiver so we also need to set the party CompanyA as Interchange Receiver.

Categories: BizTalk, BizTalk EDI

Microsoft Visual Studio LightSwitch

Visual Studio LightSwitch is a new addition to the Visual Studio family, it will give us a simpler and faster way to create high-quality business applications for the desktop and the cloud. Microsoft is going to release this on coming 26th July.

LightSwitch Beta2 is available for free download. To know more details, follow the below link:

Visual Studio LightSwitch

Categories: Visual Studio Tags:

Overview of the Microsoft Middleware Strategy….

A must watch video for the BizTalk consultants on the topic ‘An Overview of the Microsoft Middleware Strategy” by Seetharaman Harikrishnan (Hari) – GM, Microsoft, at TechEd 2011. Very informative and useful.
Watch the Video

Categories: BizTalk, WCF, Windows AppFabric

Issue: Received unexpected message type ‘http://www.w3.org/2003/05/soap-envelope#Fault’ does not match expected type ‘http://abhijit/WCF/06/2011#Operation1’

June 16, 2011 1 comment

Generally we encounter this issue when we try to consume a WCF Service with Custom Fault Contract from BizTalk. To circumvent this issue, check the WCF-Transport configuration settings of the Send port.

Select the xPath option under the inbound BizTalk message body and set the Body path expression to /*[local-name()=’Fault’]/*[local-name()=’detail’]/* | /*[local-name()=’Operation1Response’] | /*[local-name()=’Operation2Response’]

In the above xPath expression, I have used the union operation for multiple responses. So, if BizTalk receives the fault message then the Custom Fault will be extracted from /Fault/Detail path and when there is no fault then the successful response message will be forwarded to the orchestration.

Categories: BizTalk, WCF

Batching Outbound EDI messages in BizTalk Server 2009

November 2, 2010 3 comments

While working on a B2B projects, it is very common requirement to send many EDI documents at once within a single batch. From BizTalk 2006 R2 onwards we have native EDI support in BizTalk, therefore no need to use any accelerators.
We have got following components in BizTalk to accomplish batching outbound EDI messages.
        • BatchMarkerReceivePipelineComponent in the EDI receive pipeline
        • Routing Orchestration
        • Batching Orchestration
        • Upgrade Batching Orchestration
        • BatchSuspend Orchestration
        • EDI Send Pipeline
These components are installed as DLLs when we install and configure BizTalk Server EDI and AS2 and available under the “BizTalk EDI Application”.
Please refer MSDN,to have more details about EDI batching in BizTalk .

In this blog, I am going to demostrate step by step tutorial on how to implement batching outbound EDI transactions in BizTalk Server 2009.

Steps:

1. Open Visual Studio 2008 and create a BizTalk project named “Abhijit.BizTalk.EDI”.

Solution

2.Right click on the BizTalk project created and click on add existing items , browse to the folders “C:\Program Files\Microsoft BizTalk Server 2009\XSD_Schema\EDI\X120501” and select the invoice schema “X12_00501_810.xsd”.

3.Go to the project properties, sign the assembly and deploy the project to the application “Abhijit.BizTalk.EDI”.
proj1

proj2

4.Close the Visual studio and open the BizTalk Server Administrator console.

5.Right click on “Abhijit.BizTalk.EDI” application, Click on Add–>References.

AddRef

6.Select the “BizTalk EDI Application” and press OK to add the reference.

AddRef2

7.Create a new Receive Port and new receive location and set the following:
           Name of the ReceivePort : RcvInvoice
           Name of the ReceiveLocation: RcvLoc-Invoice
           Type of the RecieveLocation : FILE
           Receive Folder : <<file directory where receive location listens for incoming files>>
           Receive Pipeline : EDIReceive

 
RcvLoc

RcvLoc1

8.Now create a new party named “TestBatch” and set the EDI Properties as shown in the below images.
EDI

EDI

EDI

EDI

9. Now Select Batches–>Click on New Batch button
        Click on Filter and set the filter property as
                 BTS.ReceivePortName == RcvInvoice
         Click OK to save the filter settings.
EDI

Select the Maximum Number of Transaction Sets property and set the Interchange property to 3. This will make that a batch file will send out only when three documents are available in the BizTalk message box.
Click on the Start button to start the batching.

10. Now create a new send port and set the following properties:
                   Name of the Send Port : SndBatchInvoice
                   Type : FILE
                   Send Folder: <<Destination File location>>
                   Send Pipeline : EDISend
          Filters:
                  EDI.DestinationPartyName ==TestBatch
                  EDI.ToBeBatched == False
   Click OK to save the send port settings.

EDI

EDI

11. Now associate the send port with the party , From the Parties, Right click on the “TestBatch” party and set the send ports as shown in below image.

Party

12. Start the batching orchestrations:
            

              a. Click the BizTalk EDI application.Start all three of the batching orchestrations (shown in below image).

EDI

13.  Enable the Receive location (RcvLoc-Invoice) and Start the send port(SndBatchInvoice).

Test the solution:

    a. Drop the sample file Invoice5010.txt from in the receive location folder.

EDI

         b. Drop the same file another two times in the same receive location folder.

         c. Check the output folder. You can see a single batch file containing three files, as shown in below image.

EDI

Download the SourceCode:

To download the code please Click here

Note:Change the extension of the file from .doc to .zip and extract it into your C: drive.

Categories: BizTalk, BizTalk EDI