June 2006 - Posts - Rudolf Henning

June 2006 - Posts

After I received a request to have BizTalk(2004) zip files for some application that must have the data compressed I did some research into how to access (read) the original filename if it is available. I came across Stephen Kaufman's blog that listed a whole bunch of the 'built-in' promoted properties. Thanks to this information I was able to create a 'zip' pipeline component that can be used in the encode stage of a send pipeline.

The zipping part was done using the open source zip library by Mike Krueger (SharpZipLib).

For the benefit of those that might be interested, here is the code of the main method:

public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(
            Microsoft.BizTalk.Component.Interop.IPipelineContext pc,
            Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
        {
            string fileName = defaultOutFileName;
            System.IO.Stream originalStrm;
            ZipOutputStream zipOutputStream = null;
            System.IO.MemoryStream memorystream = new System.IO.MemoryStream();
                       
            IBaseMessagePart bodyPart = inmsg.BodyPart;
            if (bodyPart != null)
            {
                originalStrm = bodyPart.GetOriginalDataStream();
                zipOutputStream = new ZipOutputStream(memorystream);
                zipOutputStream.SetLevel(9);

                //reference: http://blogs.msdn.com/skaufman/archive/2004/10/24/247001.aspx
                IBaseMessageContext context = inmsg.Context;
                object obj = context.Read("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties");
                if (null != obj)
                {
                    fileName = obj.ToString();
                }
                else
                {
                    obj = context.Read("FileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties");
                    if (null != obj)
                    {
                       fileName = obj.ToString();
                    }
                }
                if (fileName.IndexOf("%") > 0) //variable found
                {
                    fileName = defaultOutFileName;
                }
                if (fileName.IndexOf("\\") > 0)
                {
                    fileName = System.IO.Path.GetFileName(fileName);
                }

                ZipEntry entry = new ZipEntry(fileName);
                entry.Size = originalStrm.Length;
                byte[] buffer = new byte[originalStrm.Length];
                Checksums.Crc32 crc = new Checksums.Crc32();
                originalStrm.Position = 0;
                originalStrm.Read(buffer, 0, buffer.Length);
                crc.Reset();
                crc.Update(buffer);
                entry.Crc  = crc.Value;
                zipOutputStream.PutNextEntry(entry);
                zipOutputStream.Write(buffer, 0, buffer.Length);
                zipOutputStream.CloseEntry();
                zipOutputStream.Finish();
                       
                memorystream.Position = 0; //must reset position or BT gets confused and read the end
                bodyPart.Data = memorystream;
                pc.ResourceTracker.AddResource( StreamToString(memorystream) );
            }
            return inmsg;
        }



with 1 comment(s)
Filed under: ,
I installed Opera 9.0 yesterday and I must say I like it for the most part except that some sites which worked in IE and Firefox still does not work properly. Dotnet.org.za gives some problems with posting new blog entries (cannot preview) and the forums on sadeveloper.net are just a pain. It does not support html properly and renders wrong in other browsers if you try to correct it.

The biggest advantage of Opera I can see at this stage is the speed at which it loads. It's much faster than Firefox or even IE. It supports RSS feeds, something called Widgets (Like FF extensions) and even Torrents (haven't got that to work yet).

Well, perhaps one day I'll convert to Opera completely but for now I'll still be using FF and IE for most sites.
with 3 comment(s)
Filed under:
Ever wanted to know how to use keyboard shortcuts to improve your browsing experience in Firefox? Well, stop wondering...

http://lesliefranke.com/files/reference/firefoxcheatsheet.html

There are a couple of shortcuts I didn't even know about.
with no comments
Filed under:
This is really interesting. I guy pulled some stats from his site to see what search engines big company employees use the most. Not surprisingly Google came on top but shockingly for Microsoft MSN search is not their top choice...

http://andrewhitchcock.org/companystats/

Steve Balmer must be thinking of flying chairs again....

Aside from the downloading updates issue I must say I'm very pleased with Half Live 2 Episode 1. The game graphics is outstanding and the game plays is very enjoyable. Valve has a winner with this game - if only they can solve the 'issue' of having to download more than 2 GB of updates just to play the game! Can someone please just wake them up so they can realize not everyone has Gigabyte Internet connections?
Anyway, I like the subtle changes in the game with having a second player (Alyx) accompanying you through most of the game helping with a number of things like making sense of the puzzles you have to solve and providing covering fire when needed.
There are a couple of places where you can see Valve developers made some interesting improvements to the AI to include things like atmosphere, emotions and even some humor. I was a bit surprise with the things Alyx said when the flash light goes out... naughty girl.
Although my system is about two years old it still handled the game fairly well. Loading times for some levels were a bit long and there are several places where the game almost froze up for a while trying to load things but all in all it wasn't too bad.
The one other thing I do not like is the fact that you must be online when you want to play the single player. A lot of people with old fashioned dial-up connections are not going to like that but then again they would probably not even be able to update/unlock the game due to the ridiculous update download size.

Well, thanks to Valve for a nice game.

with no comments
Filed under:
Yet another 'version' of SQL server that could be useful as an application embedded database engine. It may now be time to finally dump that Jet engine (the database one) for desktop application use.

The benefits include things like using a db engine that is more scalable, robust, better, stronger, faster...I think we can rebuild it..uhm sorry I think I'm on a six million dollar roll there Wink [;)], re-using sql skills, ease of sharing the data (eventually) with a full SQL server and so on.

Another nice thing is the relatively small download footprint, only ~1.7MB. South African users would be glad about that.

More info here

Download link: here
with no comments
Filed under:
This is great news for those with legacy apps that for some reason cannot be upgraded to .Net 2.0.

Called MSBee that is part of the Powertoys of VS 2005, the tool allows you to build solutions for the .Net 1.1 framework.

Here is the link:

http://www.codeplex.com/Wiki/View.aspx?ProjectName=MSBee

It seems that they have proper instructions on how to use it as well.
with no comments
Filed under:
If you are planning to upgrade your BizTalk 2004 environment to BizTalk 2006 then have a look at the following blog that summarize a lot of important things to remember:

http://blogs.msdn.com/biztalk_upgrade/

I would like to hear from others that have actually done this (upgrading BizTalk) to find out about 'issues'.
with no comments
Filed under:
Just is just a rant so if you don't like these kind of things don't read any further.

Recently Valve released Half Life 2 Episode one and I liked the original Half Life 2 enough to actually buy it. I though I'd continue doing the 'legal' thing and buy the game (episode one) to play it. But apparently Steam doesn't care about people buying the game legally and still expect you to download a 1.5 GB update before you can even attempt to start playing the game - no option to just play the game after just installing from the DVD. This absolutely SUCKS!
Perhaps in the US everyone got a nice fast Internet connection but we here in the good old RSA don't have that option (spit on telkom again..). Downloading the update will take me at least 6 to 8 days provided Eskom don't 'load balance' my area due to some nut in a nuclear reactor (reffering to the idiot 'forgetting' the nut there).

This is what I think: Valve is just begging people to pirate this game with sh1t like this. Next time I might not even attempt to be legal and just wait until the 'better' pirated edition comes out. In stead of fighting piracy they don't like Steam is forcing gamers to rather pirate the game to get a better game experience. I hope they get a cramp in their nuts (courtesy from Eskom)
with 1 comment(s)
Filed under:
Just when you think you just might get slightly up to date with technology they come with anouncements like this:

http://biz.yahoo.com/prnews/060606/sftu068.html?.v=51


with no comments
Filed under: ,
A while ago during a training session (BizTalk 2004 admin) it was just by accident that I came across the fact that BizTalk (2004 and 2006) came with a Windows Shell Extension that allows you to view the installed assemblies. It is similar to the shell extension that allows you to view the CAG but just specific to BizTalk. For some bizare reason it is only included in the developer install  in the  'C:\Program Files\Microsoft BizTalk Server 2004\Developer Tools' directory: The extension filename is : BtsAsmExt.dll and you can simply install it with regsvr32.exe

Once installed it adds a special system folder in Windows Explorer called "BizTalk Server Assemblies". It provides functionality to search through your assemblies for schemas, maps etc.

It's another of those missing admin tools that could really be useful on a production server where you don't have Visual Studio installed.
with no comments
Filed under: ,
As part of a test to investigate BizTalk 2006 I ported some relatively simply application from BizTalk 2004 to see how easy it would be... boy, was I wrong about the easy part!

In the end it was the 'simple' things that became the problem - doesn't that sound familiar.
The first part was easy, porting the schemas - Seemed very easy, just copy the xsd to the new project directory and include in the project. I did not realize it yet but this is where the problem started.

Then I discovered that for some weird reason the 2004 map I used for transforming one flat file to XML does not work in 2006 - some stupid error about file format not recognized. Anyway, had to manually recreate the map (all 50 or so links plus scripts plus xslt's....).
Then I created the custom pipeline for the flat file. Very easy.
Deployed to BizTalk - very easy.
Created the receive port/function and send port.
Turned it on and all hell broke loose, well, BizTalk hell I mean.
Got a bunch of errors stating 'some' file not found. Took a while to figure out some utility assembly I was referring in my maps are not deployed to the GAC - has anyone at MS every heard of proper and complete error messages??
I forgot to deploy a custom assembly with utility functionality in the GAC, did it and deployed it to the BizTalk application.
Then I got some more weird errors about the data in the sample files that are not correct - something about expected fields where there are none - considering the exact same schemas, maps, pipeline and sample files were used on BizTalk 2004 without problems this is not expected!

Then I discovered that BizTalk still got the equivalent of dll hell (assembly hell) as it caches stuff unless you stop start the whole thing - you would have thought MS could have fixed this by now...

Then there was the problem that I had to set pipeline errors to be recoverable to at least allow the document to go through even though something still was not very happy in the process.
After some fun trying this and then that and then this again with each cycle going through the stop everything, start everything routine I discovered that one little setting in my flat file schema magically fixes all my problems. Somehow the way 2006 do flat files with 'infix' child delimiters is different that from 2004. If the document has a trailing crlf combination (talking flat file stuff here) 2004 ignored it but 2006 does not. The solution in the end was simple but not so obvious set 'Allow early termination' to true.

The bottom line here is that there are small differences in the way 2006 process flat file documents - and probably other documents as well. Upgrading is not always as easy as you would like. Test all your schemas, maps and other things first before just assuming it would work.
with no comments
Filed under: ,

The following is just an opinion (mine) and everyone is welcome to differ.


BizTalk server, the product Microsoft ships must be one of the most misunderstood products out there. The mere mention of the name can make some developers laugh and say things like 'that is a waste of a product' or 'I tried it and it was bullsh*t'. BizTalk as a product is more than just a simpler way to do integration development. Few people realize it and even fewer developers...


Sure, most of the things that BizTalk can do can be done easier/better by developers creating a custom solution but then that is just what it is... a custom solution that will be thrown out the next time some management decision wants a small change... most of us has been there... got the T-shirt.


To make a short story long - just joking, when BizTalk 2004 came out it was a huge improvement for developers using BizTalk. At least now you could use proper .Net code to build a proper solution (and not go down the dark scary hole of COM+). Unfortunately Microsoft missed the boat completely in one BIG aspect of the product (BizTalk 2004) - administration and monitoring. Sure, if you are a developer with the right tools or already an expert on how BizTalk works you could manage to survive a production BizTalk environment. Unfortunately if you are not one of those, like most administrators, operators, deployers, techies are, you would be completely lost on how to manage the BizTalk environment. For that reason a number of developers created extra tools to try and make it easier to manage the product in the production environment. Unfortunately that also creates its own problem - tools created by developers usually tend to work well for only... developers.


Then BizTalk 2006 came along.


Ok, I'm not going to claim it solves all the problems of the world, even in the BizTalk world but 2006 is a step in the right direction. At least now we have an Administration tool with which you can actually manage the bits that make BizTalk tick - like the receive/send ports, Enabling/Disabling tracking etc. Probably one of the best changes are the fact that now you can logically group application related stuff together. Previously hidden settings that can influence the performance of BizTalk like threading thresholds can now be adjusted. There are lots of other smaller changes that also makes things easier - to mention one: now you can specify network credentials for a file receive/send port. In 2004 you had to jump through all kind of loops to do the same.


To summarize a summary of a summary: BizTalk 2006 is what BizTalk 2004 should have been!

with 3 comment(s)
Filed under: ,
Often I've heard people asked this question and some people seem to have their own ways around it. How do you get the original filename as it was picked up by the File Adapter? The answer is inside the BizTalk help file but as usual (with alot of MS products) it is well hidden and you actually have to know what to search for before you can find it. Anyway after some digging around (on google) I came across the proper variable name '%SourceFileName%' and with that information I managed to actually find it in the help files. The following is a copy of the available 'variables' or macros as BizTalk refers to them (apologies to Microsoft for copying this useful information ;) ):

Macro name Substitute value
%datetime% Coordinated Universal Time (UTC) date time in the format YYYY-MM-DDThhmmss (for example, 1997-07-12T103508).
%datetime_bts2000% UTC date time in the format YYYYMMDDhhmmsss, where sss means seconds and milliseconds (for example, 199707121035234 means 1997/07/12, 10:35:23 and 400 milliseconds).
%datetime.tz% Local date time plus time zone from GMT in the format YYYY-MM-DDThhmmssTZD, (for example, 1997-07-12T103508+800).
%DestinationParty% Name of the destination party. The value comes from the message context property BTS.DestinationParty.
%DestinationPartyQualifier% Qualifier of the destination party. The value comes from the message context property BTS.DestinationPartyQualifier.
%MessageID% Globally unique identifier (GUID) of the message in BizTalk Server. The value comes directly from the message context property BTS.MessageID.
%SourceFileName% Name of the file from where the File adapter read the message. The file name includes the extension and excludes the file path, for example, Sample.xml. When substituting this property, the File adapter extracts the file name from the absolute file path stored in the FILE.ReceivedFileName context property. If the context property does not have a value, for example, if a message was received on an adapter other than the File adapter, the macro will not be substituted and will remain in the file name as is (for example, C:\Drop\%SourceFileName%).
%SourceParty% Name of the source party from which the File adapter received the message.
%SourcePartyQualifier% Qualifier of the source party from which the File adapter received the message.
%time% UTC time in the format hhmmss.
%time.tz% Local time plus time zone from GMT in the format hhmmssTZD
(for example,124525+530).

These variables/macros can be used in the destination file name as specified in the File Transport Properties.
with no comments
Filed under: ,
The latest version of Ubuntu (6.06) has been released. You can order free CD's straight from them online:

https://shipit.ubuntu.com

This is a great way to get hold of this Linux distribution for those that do not have the bandwidth to download a whole CD. Just wait 4 to 6 weeks.

The best part of this all is of course the 'free' part.