November 2007 Entries
I have recently been working on a project where I have the following scenario:
  1. Receive a flat file from system X.
  2. Map the flat file to an internal message schema.
  3. Send the mapped message to a web service in system Y.
Three very basic steps, I am sure you will agree.  I did however run in to a problem with date formatting.  I had agreed with the developers of system Y, that thye shold be using System.DateTime for  their dates and not worrying about the format required by system X.  When serializing, this was fine and we got the dates that BizTalk was happy with.

I.e. 2007-10-26T17:54:57.437

Great, I could convert this to the formats i needed for system X in the maps using some custom functiods.  My problem was that in the other direction, it was quite difficult to create a date format as above.  I tried all of the string methods on the System.DateTime class and didn't really get anywhere.  I would get the error "The string '26/10/2007 17:54:57' is not a valid AllXsd value".  Luckily, I happened across this post on The Scripts.

Essentially, what is is saying is that if you use the .ToString() method witha  parameter of "s", then this will format the string according to ISO-8601, which is what the XML Schema Date is based on, and what .Net uses for serialization.

So, using

DateTime.Now.ToString("s");

will result in

2007-11-28T12:22:15.041

Hurrah!

Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist
No, I know that if you read the Microsoft curriculum, it will tell you how wonderful things like Debug.Assert() are; to a great extent, they are.

The problem with using them in an assembly that is called by BizTalk is that BizTalk runs in an Isolated Host.

What this means is, if you try to do any sort of debuggin in BizTalk with a deployed assembly, you will never see the pretty litle pop-up box.  The worker thread will simply hang in an active state until you kill all of the services and start all over.

They key thing to remeber is that the .Assert method in general pop up a little error message so that we can click OK and carry along on our merry little way.  In BizTalk however, the Isolated Host simply waits for someone to click OK.  The never will, because they can not see the box.

In short, DON'T use Debug.Assert() in an assembly that will be called by BizTalk.

(Oh boy, took me a while to figure out why my BizTalk box was being so lazy)

Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist
This is simple explaination of how to activate an Orchestration in BizTalk Server 2006 from one of two or more different activating receive shapes. We achive the end result by using a Listen shape to determing whenthe Orchestration should contine.

Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist