Configuring Subversion to Correctly Handle BizTalk Files

Subversion is a great open-source version control system, however it doesn’t work all that well with BizTalk solutions straight out of the box, particularly orchestration, pipeline and map files. In order to get these artifacts working seamlessly, there are a number of configuration changes that need to be made.
Contextual-Merging & MIME Types

When changes are received […]

BTS.MessageType = http://Nabeel#HelloWorld

Hi, and welcome to my blog.


For those of you who don’t know me: my name is Nabeel Prior.  I have been working with BizTalk for close on 8 years now, starting back when BizTalk Server was the pimple-faced and gangly younger brother to the likes of SQL Server.  Now, BizTalk is much more mature and streetwise and fully capable of holding its own within the Microsoft product family.


My continued work with BizTalk led me to an opportunity at Microsoft about a year ago, at which point I took up a job as a Senior Consultant in the Microsoft Consulting Services dvision of Microsoft South Africa.  In this role I have been able to maintain my focus on BizTalk, and I am continuously being exposed to a greater variety of BizTalk implementations.  The result is that I am deepening my knowledge of the vast feature set that makes up BizTalk, and I am continually trying to impart as much of my knowledge as I can to those that also want to develop their BizTalk skills, and learn from those that have BizTalk skills and experiences that I do not. 


I firmly believe that only through sharing knowledge and having open discussions can one truly develop one’s own skills, as well as the skills of those around you.  This belief, together with the growing interest in BizTalk globally, has led me to starting up my blog once again.  The main purpose of this blog is for me to impart ideas, thoughts, problems and solutions that I encounter in my various customer engagements, in the hope that others will be able to learn from them.  A secondary objective is that I hope I can use my blog to engage with other BizTalk developers and be challenged with scenarios I have not yet encountered, thereby continuing to grow my own skills as well.


But then what is life if it is all about work?  So, in conjunction with the BizTalk-focused posts I will also endeavour to post the occassional brain teaser as well.  I also hope to be able to launch a few innovative and fun ways for us to be able to interact with each other in the near future … so, watch this space!


Kind Regards,


Nabeel Prior

New BizTalk Server 2006 Hotfixes

A few interesting Microsoft Knowledge Base hotfixes for BizTalk Server 2006 were recently added and worthy of sharing.

FIX: The Log Shipping feature may not restore database backup files in BizTalk Server 2006.  Really?!?  Seems kinda important.  I love hotfix titles that are all nonchalant, but upon consideration, are pretty freaky. The article says that the […]

BizTalk Operations Guide

I’ve just spent some quality time going through the just-released BizTalk Operations Guide.

I can’t stress enough how significant this document is. It brings together a ton of information on the planning and operations of a healthy BizTalk environment. It provides a bunch of easy to follow checklists.

I believe that everyone involved in development or management of BizTalk solutions should read this document. In fact, you should probably read it several times a year, and refer to it regularly.

HIGHLY RECOMMENDE READING!

Really nice work from Microsoft, and congratulations to everyone involved in producing such a high-quality and practical document. From the doc….

What’s in It?

Guidance based on real-world experience. The idea for the guide originated with Microsoft field representatives, partner organizations, and customers who plan, deploy, and maintain BizTalk Server installations. This group of IT professionals has accumulated extensive hands-on experience with a diverse range of BizTalk solutions. As they gained experience they created checklists, best practices, and presentations to guide future BizTalk Server operations. We collected and organized this information to create the guide.

Key portions of this guide are new; however, a considerable portion consists of documentation taken from BizTalk Server 2006 R2 Help, white papers, Knowledge Base articles, and other sources. It has been carefully reviewed and vetted by experts from the community of BizTalk Server IT professionals and members of the product development team, whom we gratefully acknowledge at the end of this topic. We believe that the information presented here will help BizTalk Server users solve, and above all, avoid many of the common problems that can occur while deploying and maintaining a BizTalk Server installation.

The BizTalk Server Operations guide is now available for download in DOCX, CHM, and PDF file formats at the following locations:

http://download.microsoft.com/download/a/a/d/aad035e6-e03b-4bea-ad9a-fa1ff8d10ca0/BTS06R2_OpReadiness.docx
http://download.microsoft.com/download/a/a/d/aad035e6-e03b-4bea-ad9a-fa1ff8d10ca0/BTS06R2_OpReadiness.exe
http://download.microsoft.com/download/a/a/d/aad035e6-e03b-4bea-ad9a-fa1ff8d10ca0/BTS06R2_OpReadiness.pdf

Convert Excel XLS files to CSV

I continue to add features to my original ISA Control Number Randomizer for the BizTalk HIPAA adapter. My latest feature allows automatic conversion from Excel spreadsheets to CSV files. It is a nice little feature if you’re trying to consume .xls files using BizTalk. Just define your comma delimited schema and consume the file.

Current features include:

1. Randomize ISA Control Numbers for Files Already in Folder (even with multiple ISA/IEA)

2. Folder Watcher allows you to drop files into your source folder their ISA/IEA control numbers will automatically be randomized

3. Drag-n-Randomize files allows you to drop files into the application and they will be randomized and output in the destination folder you select

4. Excel to CSV converts .XLS to .CSV

Email me if you would like a copy.

Here is a screen shot of the new feature

Processing multiple queues in FIFO order with WCF

In my previous entry on Processing FIFO MSMQ Messages using WCF I said that I would cover processing multiple queues and processing each queue in FIFO order. 


 


If you remember, our requirement was to processe messages we receive from a legacy system through MSMQ in FIFO order.  Well we found that there were a couple of issues.  Neither of them was a surprise – FIFO processing is slow and there is no scale out.   


 


So, we did a little more investigation and we found that we could segment our processing by message types (each being sent through their own queue) and then process each in FIFO order.  The FIFO processing is the same as in the past blog post.  This blog entry is focused on dynamically adding and creating hosts for each of the queues.


 


We need a way to be able to add queue bindings in the .config file and have the application recognize the new queue without the need to modify code or have the application have any knowledge of how many queues would be monitored.


 


So, with this, I would set up the .config file looks like this:


 


<services>


<service name=”EventManagement.MSMQEventServiceTypeX” >


<endpoint address=”msmq.formatname:DIRECT=OS:.\private$\EventManagementQueueX”


  binding=”msmqIntegrationBinding”


  bindingConfiguration=”EventProcessorBinding”


  behaviorConfiguration=”BatchingBehavior”


  contract=”EventManagement.IMSMQEventInterface”>


</endpoint>


</service>        


<service name=”EventManagement.MSMQEventServiceTypeY” >


<endpoint address=”msmq.formatname:DIRECT=OS:.\private$\EventManagementQueueY”


  binding=”msmqIntegrationBinding”


  bindingConfiguration=”EventProcessorBinding”


  behaviorConfiguration=”BatchingBehavior”


  contract=”EventManagement.IMSMQEventInterface”>


</endpoint>


</service>


</services>


 


The idea is to be able to add a new service entry for each new message type with a new endpoint address and have the code spin up a new service host.  The code to make this happens looks like this:


 


 


public class EventProcessor


    {


        private List<ServiceHost> svcHosts = new List<ServiceHost>();


        private MSMQEventService mqevtsvc;


 


        public void ProcessMessages()


        {


            mqevtsvc = new MSMQEventService();


 


            ServicesSection SvcSec = (ServicesSection)ConfigurationManager.GetSection(“system.serviceModel/services”);


 


            string MSMQSvcName = mqevtsvc.GetType().FullName;


 


            string baseName = ConfigurationManager.AppSettings[“EventQueueName”];


            Uri baseAddress = new Uri(baseName);


 


            //Roll through the service entries and create service hosts to handle them


            foreach (ServiceElement svc in SvcSec.Services)


            {


                if (svc.Name.StartsWith(MSMQSvcName))


                {


                    object svcObj = null;


                    string Suffix = svc.Name.Substring(MSMQSvcName.Length);


 


                    if (Suffix == string.Empty)


                    {


                        svcObj = mqevtsvc;


                    }


                    else


                    {


                        svcObj = CreateMSMQObj(Suffix);


                    }


 


                    if (svcObj == null)


                    {


                        ErrorHandler.Instance.OnError(“Error creating service type ” + mqevtsvc.GetType().Name + Suffix, EventLogEntryType.Warning, ErrorHandler.WarningNumber.ServiceStarting);


                    }


                    else


                    {


                        ServiceHost newSvc = new ServiceHost(svcObj, baseAddress);


                        newSvc.Faulted += new EventHandler(serviceHost_Faulted);


 


                        svcHosts.Add(newSvc);


                    }


                }


                else


                {


                    ErrorHandler.Instance.OnError(string.Format(“Service name {0} must begin with {1}”, svc.Name, MSMQSvcName), EventLogEntryType.Warning, ErrorHandler.WarningNumber.ServiceStarting);


                }


            }


 


            // Open the ServiceHostBase to create listeners and start listening for messages.


            foreach (ServiceHost svcHost in svcHosts)


            {


                svcHost.Open();


            }


        }


 


        private object CreateMSMQObj(string SuffixName)


        {


            CSharpCodeProvider loCompiler = new CSharpCodeProvider();


 


            CompilerParameters loParameters = new CompilerParameters();


 


            loParameters.ReferencedAssemblies.Add(“System.dll”);


 


            loParameters.ReferencedAssemblies.Add(this.GetType().Assembly.Location);


            loParameters.ReferencedAssemblies.Add(typeof(ServiceHost).Assembly.Location);


 


            loParameters.GenerateInMemory = true;


 


            string Code = @”


using System;


using System.ServiceModel;


namespace EventManagement


{


    public class MSMQEventService{0} : MSMQEventService, IMSMQEventInterface, IDisposable


    {


    }


}


“;


            Code = Code.Replace(“{0}”, SuffixName);


 


            CompilerResults loCompiled = loCompiler.CompileAssemblyFromSource(loParameters, Code);


 


            if (loCompiled.Errors.HasErrors)


            {


//add code here to process errors            


            }


 


            Assembly loAssembly = loCompiled.CompiledAssembly;


 


            object loObject = loAssembly.CreateInstance(“EventManagement.MSMQEventService” + SuffixName);


 


            return loObject;


        }


}


 


There are two interesting parts to this code.  The first is at the top where the .config file is read.  The second is in the CreateMSMQObj private method. 


 


When the .config file is read the service name attribute is read and that is used as part of the class name that is used with the ServiceHost.


 


During the CreateMSMQObj method, we are dynamically creating a class for each of the service elements from the .config file. 


 


At this point we have a system that can dynamically read from multiple queues, defined at runtime, and process the messages in each queue in FIFO order.


 


This code is not the full source code and some of the processing code has been taken out for brevity.  Hopefully, this will provide a glimpse and a provide a head start to process multiple queues in FIFO order.

Large File Error when Importing a Catalog into Commerce Server 2007

Recently I ran into the following error when import a large Catalog into Commerce Server using both the Catalog Manager and the BizTalk Server Commerce Server Catalog Adapter.


“The import failed because the import file is larger than the maximum size allowed on your server. Contact your system administrator.”


 


The fix is simple and requires a change to the Web.Config file of the Commerce Server Catalog Web Service.  The default max file size is 200 MB.


Simply update the following attribute: <catalogWebService maxUploadFileSize=”204800″ /></catalogWebService>


 


Receive more details from the complete blog post located here.

Catalog Imports into Commerce Server with the BizTalk Adapter

Recently I’ve been doing some work Commerce Server 2007 and BizTalk Server 2006 R2.  I have been using the Microsoft supplied Commerce Server Adapters for integration between Commerce Server and various systems. 

For those of you who do not have a lot of experience with Commerce Server, both the BizTalk Adapters and the Commerce Server Catalog Manage use the supplied Commerce Server Web Services for Catalog Imports.

When working with large catalog imports, both tools will run into a minor limitation with the file size. 

You may start to see this error when working with large catalog imports:

“The import failed because the import file is larger than the maximum size allowed on your server. Contact your system administrator.”

This is because the default maximum file size is around 200 MB. 

Good news!  This value is very easy to update.  Simply navigate to the web.config file of the Catalog Web Service. 

Look for the following attribute of of the catalogWebService node:

<catalogWebService maxUploadFileSize=”204800″ /></catalogWebService>

All you need to do is change the value, reset IIS, and you are all set to upload larger files.

I’ve ran files in excess of 1 GB though both the Catalog Manager and the BizTalk Catalog Commerce Server Adapter.  I’m very surprised with the overall performance and shocked the whole thing does crash with such large files!