GitXplorerGitXplorer
n

DtaSpy

public
7 stars
7 forks
4 issues

Commits

List of commits on branch master.
Unverified
5b8188b6319df966a40fc90f884489e8d43d51d7

Updating NuGet.exe

rriha committed 12 years ago
Unverified
1ef6f7c6e2670a2afdb77268e2d554c16284af54

Ignoring ReSharper related files

rriha committed 12 years ago
Unverified
5dfaaa1037cbd441f5d6ae909df4cb6f120031f8

Merge pull request #3 from riha/anycpu

nniik committed 13 years ago
Unverified
b51be071f1a7cb4698c1ad755d67935517063119

Harmonizing platform setting to Any CPU

rriha committed 13 years ago
Unverified
e4866ca9dd85f1a80e887ed73046cec8117399da

Property string representation of value by default

nniik committed 13 years ago
Unverified
4d114bbf90a9ea7d3dd258a835484fffe1d25207

Adding debugger display for property bags

nniik committed 13 years ago

README

The README file for this repository.

DtaSpy

Standalone access (as in no BizTalk installation neccessary) to tracked messages and properties in BizTalk tracking databases.

There's been several attempts at exporting tracked messages and properties from BizTalk DTA (Document Tracking and Administration) databases (see 3 ways of programmatically extracting a message body from the BizTalk tracking database). Until now there's been no project which did not have a dependency on BizTalk.

The official way of retrieving tracked messages is the BizTalkOperations.GetTrackedMessage method but that requires a local BizTalk installation and it's not possible to copy the operations assembly since BizTalk depends on all sorts of COM+ support libraries and classes installed alongside BizTalk.

What can it do?

  • Retrieve and decode message parts (most notably the message body) [STABLE]
  • Retrieve and decode message contexts (properties) [BETA]
  • Serialize and fragment custom messages (write-support) [EXPERIMENTAL]
  • Serialize custom message contexts [EXPERIMENTAL]

How does it work?

All the stored procedures and tables necessary to retrieve messages and properties are available in the DTA databases. The problem is that the data returned from theese procs aren't exactly in plain text. The data may or may not be compressed and if the tracked data is large enough it may be split over several fragments.

By reverse-engineering the storage format DtaSpy is able to decode tracked messages without the need for BizTalk.Operations or other BizTalk components. All it needs is System.Data and SharpZipLib.

Disclaimer

I have never had access to a BizTalk installation. I was approached by a friend who works extensively with BizTalk who asked me to reverse engineer the data in the tracking database. He sent me a copy of the tracked data as well as the tracked message in its original format and I worked my way back from there. So while I've accumulated some knowledge about the data formats in DTA databases I'm still a complete idiot when it comes to BizTalk in general. Don't expect any help there :)

The usual disclaimers apply as well, although it won't mess up anything (since it's read-only for now) your mileage may vary as you may encounter corner-cases. Reading of message contexts is, for example, still a bit experimental. If you encounter any bugs of odd behavior please file an issue.

Documentation

A bit thin at the moment. Check the wiki for updates.

There's a sample project included in the solution called DtaSpy.Samples.Export. It's a console application that exports message parts and contexts. It's very much a quick hack to demonstrate the library but it's a good place to start.

API Sample

var db = new BizTalkTrackingDb(connectionString);
var message = db.LoadTrackedMessages().Take(10);

foreach(var message in messages)
{
    using (var fs = File.OpenWrite(message.MessageId + ".raw"))
        message.BodyPart.WriteTo(fs, false);
}

LICENSE

DtaSpy is licensed under the MIT License (OSI). Basically you're free to do whatever you want with it. Attribution not necessary but appreciated.

Dependencies

DtaSpy currently only depends on SharpZipLib. DtaSpy resolves this reference using NuGet and the project is set up to use NuGet package restore.

DtaSpy was originally written in .NET 4.0 but since there was so little work being done with .NET 4 specific stuff I backported it to .NET 2.0. It still runs fine on 4.0 though.