November 11th – International Check Your Enterprise Single Sign-On Master Secret Key Day

Let this go down in the record books that today marks the First Annual Celebration of International Check Your Enterprise Single Sign-On Master Secret Key Day!

Picture this, it is 2 AM and you are sound asleep.  All of a sudden your work pager goes off.  The datacenter is flooded (why they had a datacenter in the basement is a whole other story) and you lost the Master BizTalk Server.  The power went off and backup initially failed so all the servers restarted.  Your other BizTalk boxes are just fine but can not talk to the Master SSO server so they are not working.  Your SQL database is ok because it was higher on the rack.  Would you know where your SSO Master Secret Key is in order to promote another server to be the Master?  If so, you would be up and running in less than 2 minutes.  Otherwiseit might take hours or even days to recover.   

Did the expensive implementation consultants who have now left your company tell you something about a SSO Key file someplace but you do not know where it is or what the password is on the file (you can always try “password” first if you do not remember it)?

Put all those worries behind you thanks to today!  11-11 should be your day to re-export your SSO Master Secret Key and keep it in a safe place. 

Exporting out the Master Secret is as simple as 1, 2, 3 (http://msdn.microsoft.com/en-us/library/aa559192(v=bts.10).aspx)

1.  On the Start menu, click All Programs, click Microsoft Enterprise Single Sign-On, and then click SSO Administration.

2.  In the scope pane of the ENTSSO MMC Snap-In, expand the Enterprise Single Sign-On node

3.  Right-click System, and then click Back up Master Secret.

Remember first thing Monday, double check your SSO Master Secret Key file and have a Happy International Check Your Enterprise Single Sign-On Master Secret Key Day!

BizTalk Server 2004 Rules Engine Deployment Tool

Find yourself running the Rules Engine Deployment Wizard over and over again to export and import policies and vocabularies?  Looking for a simple push button approach to move a full configuration from one server to another?  My simple Rules Engine Deployment Tool will help with these common tasks.



This tool will do the following:



  • Export all your policies and vocabularies

  • Export your most recent policies with dependant vocabularies

  • Export policies based on a configuration file with dependant vocabularies

  • Import all policies and vocabularies in the Import folder

  • Import polices and vocabularies based on a configuration file


Download: BizTalk Rules Engine Deployment Tool



How to use this tool:


Simply extract to your C drive, build, and run it.  Vocabularies that reference other vocabularies are not really supported.  That is, you will have to name the files so that the most referenced vocabulary is imported first or use a configuration file.  Also note that the process is not transactional.  So, if something fails the import will stop in the middle.  I have included some sample policies, vocabularies, and a configuration file so you can see how to use them.



The main purpose of this tool is to move one full set of rules from one server to another server although using the configuration file you can do just about anything you like. 



I have not tested this with BizTalk 2006, but I would guess it would work.


 

Interview Answers for Biztalk Server 2004

I guess I was sleeping and forgot to post the answers to the BizTalk Interview Questions from a few posts ago. No worries though, Gustavo Echeverry went thought and answered them complete with reference!  Great work!


In any case, here are my answers.  Of course, in some cases it may be possible to have more then one right answer.


Development Focused Questions


What is BizTalk?


·         Biztalk is a messaging based integration tool.


·         Bonus: It consists of several different pieces including Business Processes (Orchestrations), BAM, Rules Engines, and HAT.


In BizTalk 2002, schemas were DTD based and allowed Xml Elements to be in any order inside a record using the <Any> keyword.  How is this different in BizTalk 2004?


·         BizTalk 2004 is XSD based.


·         BizTalk 2004 Elements default to <Sequence> and <Any> is no longer available.


What is a Message Type (i.e. BTS.MessageType) and how is it used in BizTalk?


·         Message Type is a BizTalk System property that is promoted inside a Pipeline.  It is made up of Document Name Space # Root Node Name.


How do you call a Non-Serializable .Net helper class inside an Expression Shape?


·         Add a reference to that class.


·         Make sure your Orchestration is Long Running transactional.


·         Add an Atomic scope.


·         Create an Orchestration variable of that class inside the scope.


·         Create an instance on that object inside the scope.


·         Call the method.


·         Bonus: Mention the class must be strongly signed and in the GAC.


What if the class is Serializable?


·         No transactional Orchestration or Atomic scope is needed.


What does the Value Mapping Functoid do?


·         Returns the second parameter if the first parameter is true


How do you use Auto Mapping in the BizTalk 2004 mapper?


·         Select a top level node, hold down the Shift key, drag the top level node over to the other top level node.


What is the default mapping for Auto Mapping?


·         The default is by structure.  This can be change to by node name on the map properties. (This default in the auto map messes me up every time.)


Step-by-step, how do you set up a basic, pure messaging solution taking in a flat file and send an Xml File out to 5 different places?


·         Create a Flat File schema


·         Create a Custom Pipeline using the Flat File Disassembler


·         Create a Receive Port


·         Create 5 Send Ports


·         Create a Send Port Group


·         Add each Send Port to the Send Port Group


·         Create a Filer on the Send Port Group using Bts.ReceivePortName (or something close to this)


·         Additional: no map is required but it is ok to mention it


Design (Architecture) Focused Questions


What is the difference between a Distinguished field and a Promoted Property?


·         Distinguished fields are light weight and can only be used inside an Orchestration.


·         Promoted Properties are defined inside a property schema, are tracking in SQL, can be tracked in HAT, and can be used for content based routing.


How do you achieve First-In-First-Out message processing of messages received from multiple sources using an Orchestration?


·         Use a Sequential Convoy to process the messages in the order they are received into the Message Box. 


·         Make sure Ordered Delivery is set to True inside the Orchestration Receive Port.


At high level, what do Receive Ports and Orchestration Send Port really do in terms of messaging?  What about Send Ports and Orchestration Receive Ports?


·         Receive Ports and Orchestration Send Port are both publishers.


·         Ports and Orchestration Receive Ports are both subscribers.


When working with Schemas, Maps, Pipelines, and Orchestrations how should the projects be structured?


·         Schemas and Maps in its own project


·         Or Schemas and Maps together in its own project


·         Orchestrations in its own project


·         Pipelines in it own project


What is direct binding?


·         Direct binding has three types: direct to message box, self correlating, and partner ports.


·         Used to route message between the message box and Orchestrations without using bindings or from one Orchestration to another Orchestration.


What is BAM used for?


·         BAM is used to monitor business milestones and key metrics in near real-time throughout a process in BizTalk.


What is the Rules Engine?


·         Rules are used to provide highly efficient, easily changeable business rules evaluation to Business Processes.  This allows rules to be changed without rebuilding and redeploying .net assemblies.  The Business Rules Engine (BRE) can also be called from any .net component through the API’s.


What are Persistence Points and what causes them?


·         Persistence is when the state of a running Orchestration is stored into SQL.


·         It is good enough to know various shape and actions cause persistence.  More specifically, it occurs: end of a transactional scope, at a send shape, at a start Orchestration shape, during dehydration, if the system shuts down expectedly or unexpectedly, or the business process suspends or ends.


What group does a user need to belong to in order to submit messages to the message box? 


·         The user needs to be a member of the hot group or isolated host group (assuming a default installation).


What user rights to you need to perform most actions in HAT?


·         BizTalk Server Administrator


When installing Biztalk in a multi-server configuration with a remote SQL and Analysis Services, what SQL components do you need on the Biztalk Server?


·         SQL Analysis Services Client Tools


When installing Biztalk and SQL on a Windows XP SP2 Desktop, what pre-requests are required?


·         Correct answer: A Lot.  The best answer something like I have a custom written installation document I use or I always referrer to the most current updated installation guide from Microsoft. 

Interview Questions for Biztalk Server 2004

Wow, it has been some time now since I last blogged.  I would like to say I have been super busy with tons of project work. But, actually I have been on vacation most of the time.


From time to time I get the chance to interview prospective Biztalk resource to join various projects.  Since Biztalk 2004 is such a broad and relatively new product, it can sometimes be hard to compare different resources that might have had totally different experiences.


I have put together a few questions that I like to use when interviewing possible resources to give you an idea of the types of questions you might get asked in a BizTalk interview.


The point is not to know all the answers but to be able to demonstrate experience with the product and problem solving skills.  I never penalize people for not knowing something as long as they can tell me how they would find out more about it.


At a high level, what should you know in order to be successful on a Biztalk project?


·         General to moderate .net skills


·         Basic SQL skills


·         Debugging skills


·         Understanding of Biztalk development


·         Understanding of Biztalk design (if needed)


Development Focused Questions


What is BizTalk?


In BizTalk 2002, schemas were DTD based and allowed Xml Elements to be in any order inside a record using the <Any> keyword.  How is this different in BizTalk 2004?


What is a Message Type (i.e. BTS.MessageType) and how is it used in BizTalk?


How do you call a Non-Serializable .Net helper class inside an Expression Shape?


What if the class is Serializable?


What does the Value Mapping Functoid do?


How do you use Auto Mapping in the BizTalk 2004 mapper?


What is the default mapping for Auto Mapping?


Step-by-step, how do you set up a basic, pure messaging solution taking in a flat file and send an Xml File out to 5 different places?


Design (Architecture) Focused Questions


What is the difference between a Distinguished field and a Promoted Property?


How do you achieve First-In-First-Out message processing of messages received from multiple sources using an Orchestration?


At high level, what do Receive Ports and Orchestration Send Port really do in terms of messaging?  What about Send Ports and Orchestration Receive Ports?


When working with Schemas, Maps, Pipelines, and Orchestrations how should the projects be structured?


What is direct binding?


What is BAM used for?


What is the Rules Engine?


What are Persistence Points and what causes them?


What group does a user need to belong to in order to submit messages to the message box? 


What user rights to you need to perform most actions in HAT?


When installing Biztalk in a multi-server configuration with a remote SQL and Analysis Services, what SQL components do you need on the Biztalk Server?


When installing Biztalk and SQL on a Windows XP SP2 Desktop, what pre-requests are required?


Please note that knowing that Ctrl-Alt-Z opens the Biztalk Explore when working inside Visual Studios did NOT make my list of questions.

Biztalk 2004 Development Helper Tool – A Must Have

A lot can be said about development with Biztalk Server.  For someone new to Biztalk it takes a little practice to learn some of the non-intuitive tasks related to assembly redeployment and basic Biztalk Development.



One common error message is:


Some items in the removed assembly are still being used by items not defined in the same assembly, thus removal of the assembly failed.


Make sure that items in the assembly you are trying to remove fulfill the following conditions:


1. Pipelines, maps, and schemas are not being used by Send Ports or Receive Locations


2. Roles have no enlisted parties.


 


The most common problem I see is what is required to redeploy an assembly.  To redeploy an assembly the flowing must be true:



  • project is marked with redeploy = true

  • dependant assemblies but be undeployed

  • included maps and pipelines can not still be set on a send or receive port

  • Orchestration instances must be terminated

  • Orchestrations must be stopped and unenlisted

  • hosts must be restarted to release the cache

As the number of Ports, Maps, Orchestation, and Pipelines in your solution increase, tracking down these errors and manually stopping and starting can be difficult and time consuming.



I have put together a simple Windows Application that will perform some of these basic administrative tasks to help speed up the development process.  These tasks include:



  • Set all pipeline to default and remove all maps from Send and Receive Ports (make sure you have extracted your current settings as a binding file before hand)

  • Stop all Orchestrations

  • Stop all Send and Receive Ports

  • Start all Orchestrations

  • Start all Send and Receive Ports

  • Restart all in-process hosts (uses WMI)


All this simple form does is it loops around the existing ExplorerOM and WMI provided in Biztalk. 



Download: Biztalk Server Development Helper Tool



Setup is easy.  Just review the code and run the form.  You must have the correct permissions to run the tasks and to access a remote SQL.  If you are using a remote SQL Server, put that server name inside the top right text box.  It will default to your local computer name.  As always, run this code at your own risk.



Biztalk 2006 greatly simplifies this process.  In the mean time, if you are looking for something more powerful take a look at Jon Flander’s Biztalk Snapshot Tool


 

Using Dynamic Transforms (Mapping) in Biztalk 2004 Orchestrations

Dynamic mapping is the concept of specifying the map to be used for a transform at runtime inside the orchestration. That means no Transform Shape is used to specify the map or input and output schemas.



The help guide talks about dynamic mapping. It is under the heading “Assigning to Transforms Dynamically”. The help guide does not go into any detail as to when or why you would want to use dynamic mapping. In fact, the help guide makes the topic seems more complex then it really is.



Dynamic transforms can be used any time you have the same business process that needs to have the same or different message types sent into it but they need to have different maps based on some parameter.



Example: We are receiving a standard invoice from multiple locations for the same vendor. The schema is exactly the same but the mapping of the vendor data to the base schema (date formats, currency conversion, etc.) is slightly different based on the vendor location.



Why not map on the Receive Port? This is the most common solution to this type of scenario. This uses document normalization to transform all your messages into the same type before it hits your business process. This is a great solution but what about exceptions?



Exceptions in maps on the Receive Port can be hard to react to and even harder to orchestrate a retry or recovery process. That is when mapping inside an Orchestration and Dynamic Maps come into play.



Calling maps inside an Orchestration provide a mechanism for exception handling, reprocess, and error notification. Dynamic maps allow for greater flexibility by allowing countless maps to be called without a Transform Shape.



With dynamic maps, the map name can be stored inside an attribute in the message, read from the SSO, or read from some other custom component. Then, it is as simple as creating a System.Type with the strong fully qualified map name.



This would look something like this:


tMapType = System.Type.GetType(“DynamicMaps.Map_A, DynamicMaps, Version=1.0.0.0, Culture=neutral, PublicKeyToken=faed587cb93de4ea”);



construct Out_Xml


{


transform (Out_Xml) = tMapType(In_Xml);


}



If the map is inside the same assembly as the Orchestration, the full strong name is not needed. On that note, your maps usually are always inside a separate assembly…



It is important to point out this code needs to be inside an Expression Shape. The help guide says a Message Assignment shape. But, that will give a build error. If you want to use the code inside a Message Assignment shape just remove the Construct key word.



Sounds too good to be true? This does have one major drawback. If the message type of the input message does not match the message type expected in the map you get a blank message contracted. This can be seen in the sample below by running the RunMapType_ConstructBlank.xml message. So, it is import to check for this after the map.



I have put together a sample the shows dynamically calling maps inside an Orchestration both in the same assembly and inside another assembly.



Download: Dynamic Maps Inside an Orchestration



It is also common to see dynamic maps used with untyped messages (that is messages received as XmlDocuments).


Direct Binding Sample for BizTalk 2004

Direct Binding Sample for BizTalk 2004

Direct binding in Biztalk Server 2004 can be used to send messages from one Orchestration to another.  It can also be used to send messages directly into the message box, but that is not the focus of this post.  Direct binding is easily misunderstood, specifically Partner Port binding since can be somewhat confusing to set up.


I will walk through the 4 simple steps to set up direct binding using partner ports.


It is important to note direct binding still uses the publish and subscribe system in Biztalk to send messages between Orchestrations.


Terminology:
Orchestration1 – The process that will send the message to another Orchestration.


Orchestation2 – The process that will receive the message from another Orchestration.


Step 1: Create a new port and port type in Orchestation2.  Note that you can also use any existing internal or referenced public port type.


Biztalk Direct Binding Step 1


 


Step 2: Set Porting Bindings.  Select Direct Binging, Partner Port – 3rd radio button.  Select the new port you are creating in the Port On Partner Orchestration drop down.


Biztalk Direct Binding Step 2


 


Step 3: Create a new port in Orchestration1 using the existing port type created (or selected) in Step 1.


Biztalk Direct Binding Step 3


 


Step 4: Set Porting Bindings.  Select Direct Binging, Partner Port – 3rd radio button.  Select the port you created in Step 2 on Orchestration2 in the Port On Partner Orchestration drop down.


Biztalk Direct Binding Step 4


 


It is that easy.  If you have additional questions or want more information on Direct Binding, Charles Young has by far the best blog posting on this subject.


I have also put together a sample.  This sample shows how to use Direct Binding with Partner Ports to send a message from one Orchestration to another. 


Download: Biztalk Direct Binding Sample


To run the sample, just deploy the solution and start both Orchestrations.  Drop a message into the In folder and it shows up in Out.  Check HAT, you will see both Orchestrations ran.

Updated Version of Biztalk 2004 Pipeline Component Wizard Available

Martijn has made some excellent updates to his
pipeline component wizard for Biztalk 2004. 

This visual studio
wizard is a must have for anyone trying to write custom pipeline components. 

This new version
supports IDisassembler and message spitting.  It also has useful comments for each
method explaining what each one does and how to use them.

This wizard can be
downloaded from his GotDotNet Workspace.

BizTalk 2004 Installation Problems on Windows 2003 With SP1

Have you seen this error when installing BizTalk 2004?


Failed to deploy BizTalk system assembly “C:\Program Files\Microsoft BizTalk Server 2004\Microsoft.BizTalk.GlobalPropertySchemas.dll”.


Unspecified exception: An error occurred while enlisting in a distributed transaction.


I ran into this a few weeks ago when trying to install BizTalk 2004 on a Windows 2003 Server with SP1 preloaded and using a remote SQL Server.



It appears that like Windows XP SP2, Windows SP1 changes some DTC settings.  This does not affect BizTalk when SQL is running locally of course.



After working with Microsoft Support for about 2 days.  It turned out that the fix is rather quit easy.  In our case, we had some other issues that made it seem much more complex then it was. 


  


To correct this problem, go to Component Services, My Computer Properties, DTC tab, and then Security Configurations (bottom left).


1.  Follow the standard BizTalk Installation instructions for setting up DTC.


2.  Under Client and Administration, make sure “Allow Remote Clients” is checked. 


3.  Under Transaction Manager Communication, make sure “No Authentication Required” is checked



The end result was changes to two registry settings:


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft
\MSDTC\AllowOnlySecureRpcCalls is now 0


 


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft
\MSDTC\TurnOffRpcSecurity is now 1



The UI now looked like this:


BizTalk Integration with Sharepoint and InfoPath Lab

Curious on how you can use Sharepoint, InfoPath, and BizTalk 2004 together?  This hands on lab will take you through a simple integration scenario step-by-step using Sharepoint and InfoPath to display delivery exceptions using Delivery Notification inside an Orchestration using BizTalk 2004. 



This lab will take around 60 minutes to complete and is based on Microsoft’s hands-on-labs.  Sharepoint (or Windows Sharepoint Services) and the Sharepoint Adapter for BizTalk 2004 (available on GotDotNet) are required.



Download: Sharepoint-InfoPath Hands On Lab



Setup is simple.  Unzip the download to your c:\ drive.  Make sure the root folder named “Microsoft Hands-On-Labs” is located at c:\.  The lab manual is located under \ILL019_InfoPath.  The exercises are located in the \Source\Exercises folder.  The full solution is located in the \Source\Solution folder.



Although newbie’s to BizTalk can complete this lab, it covers advanced topics.  If you are new to BizTalk, do not get discouraged if you find this lab difficult.