The BAM Portal website Default Web Site is not valid

I have recently encountered an error during the Microsoft BizTalk Server installation. I encountered the following error while attempting to configure the BAM Portal in the Microsoft BizTalk Server Configuration window. And because of this failed to configure BAM Portal.
 When click on not configured BAM Portal then below window will open, Select Enable BAM Portal check box to configure and enable the BAM Portal.
 Once you check the BAM portal check box, configuration window will come like below with error mark. click on error icon to see the full details of error.
Configure the Web service accounts with proper account but still you will see the error icon in BAM portal Web Site. When you click on error icon of BAM portal Web Site, you will find the below error window with error,
Failed to validate BAM Portal Web Site (BAMPortal)
The BAM Portal website Default Web Site is not valid. (Microsoft.BizTalk.Bam.CfgExtHelper.PortalHelper)
Unknown error (0x80005000) (System.DirectoryServices)
The main root cause for this error is the "IIS 6 Management Compatibility" windows feature missing. If the IIS6 Compatibility pack is not installed then installing that should solve the problem.

Please follow below steps to resolve the issue:
Go-to Control Panel -> Programs and Features -> Turn Windows features on or off -> Internet Information Services -> Web Management Tools -> IIS 6 Management Compatibility

Please look into below screen shot for reference,

Check all under IIS 6 Management compatility and install (I guess Metabase compatibility is the one that is required but check all just in case). Your configuration should look like above snap shot.

This will resolve your issue and error icon will no more available. Click on Apply configuration.
 This time it should configure without failure.


Exposing orchestration as WCF service biztalk example

I am going to demonstrate how to expose an Orchestration as WCF service & then consuming this exposed service using a WCF client.

Overall flow of the solution :
1. Creation of a solution
2. Creation of a BizTalk project in the solution which contains an XML schema & an Orchestration.
3. Publishing the Orchestration to IIS using BizTalk WCF publishing wizard.
4. Creation of a C# console project in the same solution.
5. Addition of the service reference of the above exposed orchestration into the C# console application.

Schema :

Created an XML schema with 'Status' field as distinguished field.

Orchestration :

The Orchestration simply receives a message from a folder path & the Status
of the message is changed to 'received' & then this new message is send to a
output folder location.

There are two messages used in the orchestration one for receive shape & one
for send shape but these two messages uses the same schema as message type.

The message assignment shape simply copies the input message into output &
then assigns the status field as 'received'.

After doing all this I'll build this BizTalk project & deploy this project to
Admin console.

Exposing the Orchestration :

Our brand new orchestration is ready to be exposed to IIS. We a wizard to
to perform this thing. In visual studio -> tools we have BizTalk WCF publishing

After clicking next we have two options Service Endpoint & Metadata only endpoint.

We'll choose Service endpoint & also create a receive location in the deployed BizTalk

After that clicking next we see two options of exposing either schema or
Orchestration.Choose Orchestration & click next.

Then we need to choose our Biztalk project dll.

After clicking next a receive port is created with the name specified on
the logical port in the Orchestration.

After clicking next Specify the appropriate namespace for our service.

After clicking next we have the option to locate our service. We can use
localhost to deploy the service on local IIS server or we can change host
to deploy the service on any other machine's IIS server.

On clicking next a WSDL is created for our service.

After clicking next a new receive location is created in the our project
in the admin console. We need to enable this receive location to browse
our WCF service.

Next step is to browse the service from the IIS.

Our exposed Orchestration service looks like below screenshot.
We need to copy the link in the explorer so that a service reference can be
added to consume this service.

After that I have created a new C# console application to act as a client
for our WCF service calling. Now we need to add the service reference of our

Paste the URL copied from the explorer & click go.
Our service will be discovered & change the namespace.
This namespace will be used in our client to call the service.

Now in the client code we create an object of the client WCFClient.
An object of the root node of the schema is also created. We pass the
appropriate values to this object & call a method which is nothing but the
operation specified on the logical receive port in the Orchestration. Then
we close our client.

We simply start a new instance of our console program.
This will create a new message which will be passed to the
logical port of the orchestration & finally the message will be
processed by orchestration & a new XML file will be created at
the output folder.

Note: Original post by Rahul Madaan from biztalkvillage


Different methods of property promotion inside Orchestration

What is Property Promotion ?
Property promotion is a core concept in BizTalk which is used for subscription. Basically property promotion writes that particular property's value into the context of the message and also promotes it.

Now there can me many ways to do Property Promotion inside BizTalk Architecture. I have come across three ways to do it. If you guys find out more, do tell me !!!!!

1. Promotion using Schema : 

This is pretty simple and every BizTalk developer (New or Experience) must be aware of it. Using Quick promotion will create an Property Schema automatically with the property ID in it.

2. Promotion using Custom Pipeline component :

Properties can be promoted using Custom Pipeline component using a simple one liner .NET code i.e.

// Promote the MessageType property

string messageType = “http://” + “schemas.demo.com” + “#” + “Request”;
message.Context.Promote(“MessageType”, BTSSystemPropertiesNamespace, messageType);

The Promote() method is used to write the property value into the message context but also sets the property as promoted so that it is available for routing. 

3. Promotion using Correlation (Initializing an correlation set):

We all know we need Correlation set and correlation type inside the Orchestration to create correlation. Correlation set is based on correlation type which is set of properties with some values. When we Initialize a correlation set automatically these properties are promoted in the context of that message. Well one more thing you don't need to follow the correlation set in case you just want to promote the properties. Initializing correlation set won't create an subscription it will just promote the property.

Lets see how to do it :

1. Creating a property schema with the desired property to be promoted

Note: Change its Property Schema Base to MessageContextPropertyBase. By doing this we are creating a custom property to flow with the message context.

2.  Create an simple Orchestration which will receive a message transform it into other message and send the message to File folder.

3. Now create a correlation type selecting the ID property that was created in Property Schema.

4. Create an correlation set using the above created correlation set and Initialize that set on the send shape.

5. Other thing to note here is that we need to initialize this property in order to use it further for promotion, so I have just assigned an value to this ID property inside an message assignment shape.

6. Finally after building, deploying , configuring this application and dropping an sample file at receive location we get the desired output i.e. ID field getting promoted. :)

Note: Original post by Rahul Madaan from biztalkvillage


Sequential convoy using listen shape in biztalk example

What is Sequential Convoy in BizTalk ?
A sequential convoy enables multiple single messages to join together to achieve a required result. A sequential convoy is a set of related messages that have a predefined order. Although the messages do not have to be exactly the same, BizTalk Server must receive them in a sequential order.

Listen Shape in BizTalk Example -:
Listen shape in BizTalk is the most powerful shape available in Orchestration developer toolbox. It can be used in many design patterns for BizTalk Soluton. Listen shape listens for some event to take place in its every branch. Suppose there are 3 branches in Listen shape and an event on 2nd branch takes place then all other branches would get terminated.

Sequential Convoy using Listen Shape 
I am going to demonstrate a sequential convoy using listen shape.
Suppose we have a file for Purchase order (PO) and a second file for Customer detail for that particular PO. We have to concatenate these two files and send it further.

Schema for 1st File i.e PO :

Since we are using Sequential convoy we need to define a correlation set and type. Therefore I have promoted the PONo field in both the schema.

Schema for 2nd File i.e Customer Details :

Destination Schema :

Orchestration goes like this :

In Orchestration I have used a Uniform Sequential convoy which means that the Orchestration can receive messages from same logical Orchestration port. There are two receive shapes in Orchestration where the 1st receive shape initializes the correlation set and is marked activating. The 2nd receive shape follows the correlation set. The only thing that we need to take care is that ordered delivery property of the receive port must to true.
First branch of Listen shape contain receive shape and transform shape. When Orchestration receives the PO file, the orchestration becomes dehydrate and waits for the 2nd file i.e customer file to arrive. If the file comes before the time specified in the delay shape then the first branch of listen shape executes otherwise second branch of expression shape executes.

Map :

Input Files :

PO file :

<ns0:PO xmlns:ns0="http://Working_With_ListenShape.SourceSch">

Customer file :

<ns0:Customer xmlns:ns0="http://Working_With_ListenShape.SourceSch1">

Output :

Case 1 : When 2nd file arrives before the time specified in delay shape.

Case 2 : When event on Delay branch happens then output in Debug View :

Note: Original post by Rahul Madaan from biztalkvillage


Passing a message to BRE using call rules shape in biztalk

Business Rule Engine is a powerful tool in BizTalk stack for creating, testing, publishing, and deploying rule sets for our Business process. I am going to demonstrate how to call a policy from an Orchestration using call rules shape using message as the parameter.

Scenario : Suppose we receive a Customer details message which also contains the CustID. We'll check the CustID and see if the Customer is new or already a member. If the customer is new we'll set the IsNew field to YES.

First of all we'll start with creating FACTS in BizTalk Rule composer.
Open BizTalk Rule composer and go to Vocabularies and create a new Vocabulary and then create a new definition for XMLSchema and select the schema created in the project. For CustID a get operation is created as follows :

For IsNew a set operation is performed as follows :

After creating the vocabularies publish the vocabularies so that it can be
used to create a Policy.

Next step is to create a Policy and a rule in BRE. It goes like this :

This Policy is created such that any CustID greater than 21 would set the
IsNew field to YES. This Policy will be called from the Orchestration using call
rule shape.

Input Schema :

The input schema contains Customer details which contains fields CustID and IsNew.

Orchestration view :
The Orchestration contains a receive shape, send shape, logical receive port and send port. A message is created using InputSchema as message type.

Call rules shape :
In call rules shape the policy that we have created is selected and parameters will automatically be populated. In this case Message_2 is shown. This whole message is passed to BRE and in return modified message is received.

Input Message :

<ns0:Root xmlns:ns0="http://BRE_Samples.InputCustomer">

Output message :

<?xml version="1.0" encoding="utf-8"?><ns0:Root xmlns:ns0="http://BRE_Samples.InputCustomer">

Call rule shape not any showing parameters ?? 
This problem is related to BRE facts that we had created. When developing facts we have to specify the DocumentType property of the fact. This property should be same as the fully qualified name of the schema otherwise the call rule shape will not show the any parameters. This issue is of call rule shape not finding the matching message to the schema which is deployed with the rule.

Note: Original post by Rahul Madaan from biztalkvillage


Parallel shape in biztalk example

Parallel shape in BizTalk is most confusing shape in Orchestration toolbox. I am going to give an example of parallel shape for removing this confusion.

What does Parallel shape in BizTalk do ?
Parallel shape in BizTalk is NOT used for concurrent processing. The Parallel shape enables you to complete different stages of business process without having to wait for another part of the business process to complete. It does not provide a separate thread per branch.

Example :

I have created an orchestration with a parallel shape which have 3 branches containing 3 expression shape.

1st Expression shape :

2nd Expression Shape :

3rd Expression Shape :

How parallel shape works :
When we drop a file at receive location Orchestration in instantiated and when control reaches the parallel shape, it starts it execution from left to right i.e. the 1st expression shape runs firstly and then rest of them. Even if we insert delay shape after 1st expression shape the 2nd expression shape does not get starts.So therefore parallel shape is not about concurrent execution.

Output in DebugView :

Note: Original post by Rahul Madaan from biztalkvillage