Using Enterprise Library 2.0 in the BizTalk Server 2006 applications with SSO

Enterprise Library 2.0 was released early this year. The library consists of several application blocks for so called enterprise level applications; logging, data access, security, configuration, exception handling, and so on.
BizTalk Server 2006 provides a great tool for BizTalk Server configuration, but it doesn’t seem to have any tool for the application configuration running on BizTalk Server.
Of course, you can use the configuration application block included in Enterprise Library 2.0, but you should touch the BTSNTSVC.exe.config file that is a system-wide resource.  Otherwise, you can use the SSO store to manage the configuration, but you still need to make a custom management tool, and it couldn’t be well integrated with Enterprise Library 2.0. .
I thought the best way to solve these problems should be to implement a SSO configuration source for Enterprise Library. In this way, you can use the Enterprise Library configuration tool to save your configuration information, and the application blocks in Enterprise Library can be more seamlessly integrated into the BizTalk Server 2006 applications. 


How to install the SSO configuration source:



1) Download the SsoConfigurationSource.VSTS solution and unzip it to the C:\BizTalkServer2006RTWSamples folder.
2) Compile the sample solution. It is recommend downloading Enterprise Library 2.0 from the Microsoft patterns and practices Web site, but you don’t need to do that because this sample includes all of the executables in the EnterpriseLibrary2.0Signed folder.
3) Run the following command to create the SSO application for the application blocks in Enterprise Library: DummyApp.xml is in the TestData folder of the SsoConfigurationTest project.
ssomanage -createapps DummyApp.xml



How to test the SSO configuration source:



4) Open EntlibConfig.exe that is the configuration tool for Enterprise Library 2.0, which is included in the EnterpriseLibrary2.0Signed folder.
5) Open DummyApp.config using EntlibConfig.exe. DummyApp.config has a full sample configuration information for Enterprise Library. You can pick up just a few of the application blocks as you need.
6) Create a new Configuration Sources.

7) Remove System Configuration Source, and then add Sso Configuration Source.

8) Set the ApplicationName property to Dummy, and then set the SelectedSource property of the Configuration Source node to SSO Configuration Source.
9) Save it. It will save the configuration information in the file to SSO. (You can also create configuration information from scratch or export the existing configuration data in SSO to an external file.)
Now, you can use Enterprise Library in the BizTalk Server applications like:


Database db = DatabaseFactory.CreateDatabase(“Dummy Connection String1”);
db.ExecuteNonQuery(commandType.Text, “Delete Orders”);

I’m now writing documentation for this sample component, which will be published at end of June. I’m going to update the codes as well until that time. But, if you have any opinions, or feedbacks for this component, please let me know. I’d like to keep updating this component even after it is published.


 


 

How to configure IIS for a BizTalk 2006 HTTP Receive Location

First thing you need to do is to make sure that IIS’s security is not going to be blocking your calls to the BTSHTTPReceive.dll.  To do this goto your IIS manager and click on the Web Service Extension node and right click it and ‘Add a new Web Service Extension’.  Now browse to the location of BTSHTTPReceive.dll (by default installation its in <drive>:\Program Files\Microsoft BizTalk Server 2006\HttpReceive\ folder).  Also remember to check the ‘Set extension status to Allowed’ checkbox.  It is also a good idea to create a new application pool for your application to run in.  When creating one make sure that the user account used is a member of the BizTalk Isolated Hosts group and the IIS_WPG group.


Now your going to create a new virtual directory in IIS under Default Web Site.  Make sure you link the location of BTSHTTPReceive.dll in the content directory.  Also make sure you use the new application pool you just setup.  Make sure that both Read and Execute permissions are selected, and that Execute permissions are set to Scripts and Executables.  After this you should be all set to start setting up your HTTP Receive Location within BizTalk Explorer.  Enjoy.



-B

5-day BizTalk boot camp in Redmond in July!

QuickLearn is offering a 5-day BizTalk boot camp in Redmond the week of July 17th. This class is designed for individuals who are new to BizTalk Server 2006.


 


You can find more information at:  www.quicklearn.com/bootcamp.htm


 


There is a multi-student discount of $500/student when an organization registers two or more individuals from the same company. Also, companies can get a free seat when they book three paid students. MS employee price is $1250.


 


For more information and/or to sign up, please contact Greg Bulette.


 

5-day BizTalk boot camp in Redmond in July!

QuickLearn is offering a 5-day BizTalk boot camp in Redmond the week of July 17th. This class is designed for individuals who are new to BizTalk Server 2006.


 


You can find more information at:  www.quicklearn.com/bootcamp.htm


 


There is a multi-student discount of $500/student when an organization registers two or more individuals from the same company. Also, companies can get a free seat when they book three paid students. MS employee price is $1250.


 


For more information and/or to sign up, please contact Greg Bulette.


 

Bindings File Format

The BizTalk Server 2006 bindings file format is documented here, but the XSD description of the bindings file is not included in the build.  If you are interested in having this XSD, you can produce it via the following command:


xsd.exe “C:\Program Files\Microsoft BizTalk Server 2006\Microsoft.BizTalk.Deployment.dll” /type:BindingInfo


The xsd.exe tool comes with .NET Framework SDK.

System.Diagnostics.Process, RedirectStandardOutput process hanging

In one of our internal web app’s developement, we were executing an console applications with certain arguments synchronously and were trying to display the results in the front-end.

When we activate the process I can see the process getting kicked-off in the task manager and it never exits, after a time period (IIS timeout setting), the web app times out.

At the end we figured out, the reason is due to an dead lock condition between the parent process (w3wp) and the child process(console app).

Synchronous read operations introduce a dependency between the caller reading from the StandardOutput stream and the child process writing to that stream. These dependencies can result in deadlock conditions. When the caller reads from the redirected stream of a child process, it is dependent on the child. The caller waits on the read operation until the child writes to the stream or closes the stream. When the child process writes enough data to fill its redirected stream, it is dependent on the parent. The child process waits on the next write operation until the parent reads from the full stream or closes the stream. The deadlock condition results when the caller and child process wait on each other to complete an operation, and neither can proceed.

Solution is really simple, look at the code snippet below.

// Start the child process.
Process p = new Process();
// Redirect the output stream of the child process.
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = “Write500Lines.exe”;
p.Start();
// Do not wait for the child process to exit before
// reading to the end of its redirected stream.
// p.WaitForExit();
// Read the output stream first and then wait.
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();

BTW, most of explanation is from MSDN, but it took me a while to figure out.

MS BRE: Using ’OR’ in MS BRE Rules

This article explores and sheds some light on a feature of the Microsoft Business Rules Engine which I consider to be important in understanding the semantics of rules.   This is the use of ‘or’ to create a group of conditions within a rule.   We will see that ‘or’ has a very specific meaning in Microsoft’s rule engine and that this meaning may not be quite what you might have expected.   We will also see how the MS BRE simplifies the model, making rule creation more intuitive than it might otherwise have been, and we will compare and contrast the use of ‘or’ in the Microsoft Business Rule Engine with the use of ‘or’ in a similar Java-based rules engine called Jess.


 


http://geekswithblogs.net/cyoung/articles/79500.aspx