BizTalk Server 2006 comes with a library called Microsoft.BizTalk.Operations that allows you to do common operational queries on the BizTalk message boxes and tracking databases. The concept is very cool and it is something very needed for a product like BizTalk; particularly since the WMI-based API wasn't fully updated in 2006 to reflect model changes.

Unfortunately, while the Operations assembly might seem very nifty at first, the reality is far less interesting: Like many other cases, Microsoft decided here to "play it safe" and only expose a tiny fraction of the library's functionality.

BTSQuery

One of my favorite features in BizTalk Server 2006 is the Group Query page in the Administration Console (it rocks!). Thought you could do the same queries with Microsoft.BizTalk.Operations? I did to. Well, no, you can't. The BizTalkOperations class, unfortunately, only exposes basic enumeration capabilities.

That means you can use M.B.O. to get a list of, say, all Service Instances, but after that, you're on your own filtering them (and good luck if you've got a few thousand instances hanging around). You wanted a list of subscriptions? Nope, you can't; you can only get subscriptions associated with a specific service instance.

All the functionality necessary to create and execute your own custom queries like those in the Administration Console is indeed in M.B.O. and used by MicrosoftMicrosoft.BizTalk.Administration.SnapIn, but it is internal :-(. Why, oh, why?

On a related note, whoever came up with [InternalsVisibleTo] is starting to seriously piss me off. The idea was good, but too many people running around using it for evil purposes

Technorati tags:


Tomas Restrepo

Software developer located in Colombia.