April 2007 Entries
OK, so it looks like someone has put together a tool for unit testing BizTalk Server.

Wow, I wish I'd know that this existed on some of my previous projects.  I'm going to have to go and play with this now and see just how good it is.  I normally end up writing a whole heap of extra BizTalk stuff (i.e. pretend SAP systems etc) to test my solutions, I hope this will make things quicker and easier for us all.

You can get more information on Kevin B Smith's blog

Worth a read I feel

Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist
One of our guys came up across this error recently on a system we have been developing for one of our clients.  It's not en error that I have seen before so I thought it worth mentioning.  The full error was:

The InboundTransportLocation is disallowed. This could be because the receive location is disabled or its service window is currently inactive.

It took us a bit to figure out (i think about 10 minutes combined), and it turns out that the document that we were receiving was invalid and we were using an XMLReceive pipeline with the AllowUnrecognisedMessage property of the pipeline set to False.

So, yeah, this was the correct message.  Ideally, this is a scenario you don't run in to much, as in the perfect world you always receive valid documents.  I guess we all know that is a bit of a pipe-dream.

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

So we have .Net 2.0 and we also have .Net 3.0 (which is really just .Net 2.0 with a bunch of extra cool stuff added).  What more, well - .Net 3.5 is on the horizon.  This really is a new release of the framework and, unlike 3.0, also is accompanied by a new version of Visual Studio .Net.

Right now this new version is in Beta 1 and its possible a little flakey.  I have it installed on my machine, but irritatingly I can't do anything as there are no templates asides from the Empty Solution template.  I got a little miffed at this, but nicely enough, the Express editions are also available in Orcas mode.  It may be worth having a look and trying out some of the new things if you get time.  Use the MSDN Roadshow 2007 notes to give you some example to play with if you like.

Enjoy!!


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

Excellent stuff!!  I popped along to this event yesterday in Reading.  It was all very last minute for me as someone else was supposed to be going instead of me.

The day itself consisted of four main sessions, each followed by a quick 'how-to' session for Office 2007.  Basic summary of what was covered is:  LINQ and .Net language enhancements, AJAX, XAML, Data Advances in VS 'Orcas' and Windows Live.

By far, I was most interested in the LINQ and language parts, which also tied in very nicely with the Data Advances in VS 'Orcas' session.  So much so, that I'm currently installing Orcas on my laptop as I type (I do hope I doesn't fry it!).  The first session was presented by a guy called Daniel Moth, great session and a nicely enthusiastic guy.  It was really good to see complex bits of cod cut down to a single line.

You can go to the link below to find more information and get the slides of the topics covered:

http://blogs.msdn.com/ukdevteam/archive/2007/02/15/uk-msdn-roadshow-2007-resources.aspx

It looks like there is some really good stuff about to/coming out of Microsoft at the moment.  It’s something to watch.  I'll post up any cool things I find in Orcas (there will probably be a few).


Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist
When you have a fairly active DB, your going to get a pretty large log file unless you have a suitable maintenance plan.
 
We've had a few problems before where large log files have taken up all of the available disc space, causing application problems when acessing the DB.
 
If you don't need the logs, then this will tell you how to shrink them.  But you must set up maintenance plans to look after you databases and conserve resources (it will also make your DBs a little more efficient).
 
If you don't know how to set up a maintenance plan, read this article.  If you still don't know after that - then find someone who does and they might be able to help you out.

Anyway, on to the task of shrinking the log file.  I use a fairly dirty method to do this myself, but it works and frees up diskspace instantly.  It is not appropriate if you actually need the log files.
 
What you need to do is this:
  1. Open SQL Enterprise Manager (EM) and connect to your database server with the huge log file(s).
  2. Select the DB in question and go to
    Tools>SQL Query Analyser
  3. In Query Analyser, execute the following command:
    BACKUP LOG <DATABASE NAME> WITH TRUNCATE_ONLY
    GO
    This will truncate the log for you, but won't reductthe file size just yet.
  4. Back in EM, alternate select on your DB and got to
    All Tasks>Shrink Database
  5. In the window that opens, click the 'Files...' button.  This will open a new window.
  6. Change the select list at the top tospecify the log file (usualy ends in '_log') and under the Shrink Action section, select 'Truncate free space from the end of the file'.
  7. 7. Click OK, and then click OK again.
  8. 8. Done - make some tea or coffee, take a deep breath and relax.  You log file is now smaller and you got some disk space back.
WARNING: If you are at all uncertain about any of these steps, go find a DBA or someone who know more about SQL to help you.

Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist
In BizTalk 2000 and 2002, document tracking can be a right royal pain in the bottom if you (or a predecessor) leave it on by mistake.

In one particular example, Document Tracking was left on and database InterchangeDTA mdf file filled the disk up (22gb) when client put through large # of XMLs. As the data was not required we detached database, deleted db and recreated db using a generated script from an identical version/type of BizTalk (details below). 300k suspended messages were also removed.

Quick, Cheap and Dirty Resolution:

First of all confirm with client you need document tracking on. If not turn it off. It makes life easier.
 
If you do need to keep it on then you need to design a maintenance plan using the commands and purge stored procedure described below in a sql job.
 
Assuming now you haven't maintained tracking and your disk is full, if you need to retain the data then you will need to lookup the sql commands BACKUP LOG XXX, SHRINKFILE XXX, SHRINKDATABASE XXX and install the stored procedure 'dta_purge_old_records' (found in Microsoft BizTalk Server/Setup/) to reduce the size. Research to find how to use. You can specify cut-off point in hours e.g. 24 will purge every thing apart from the last days tracking.
 
If you do not mind losing all the tracking data then you can totally replace this db by:
  1. Detaching InterchangeDTA
  2. Creating a generate db script of InterchangeDTA from another machine
    CAUTION: Ensure you find out whether the version you are working with is a Partner edition or Enterprise edition and create a script with the same type). If you do not you will get group related errors and BT messaging service will not start!
  3. Run the create db script in master (ensuring you update folders at top of script).
  4. Ensure that the relevant users have read/write permissions on this new database (otherwise you may have problems starting the BizTalk messaging service).
The 300k suspended messages were removed by running the command DELETE FROM cs_SuspendedQ in the InterchangeSQ database. This did not seem to have any side-effects (thank goodness).

Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist
This is an issue we picked up on when trying to crowbar nice features in to BizDesk on Commerce Server 2002.
 
Essentailly, we did a piece of work in .Net that we want to be able to call from the BizDesk (which is all nasty classic ASP).  The achieve this in development, there are a couple of things that you do to make you assmeblies work.
 
You basically add the entire universe according to Bill Gates in to the GAC (Global Assembly Cache), and then you run REGASM from the .Net command prompt on the key entry point assemblies (i.e the ones that you want to use Server.Create on).  For dev, this is fine.  But when we come to deploying things its no fun, so this is what you do...
Resolution of Problem:    
In our exciting little setup project in vs.net, we make sure that two things are done.
  1. The primary output of all of the projects we need is added to the file system fodlers
  2. The primary output of all of the projects we need is added to the GAC folders (reight click, add special folders blah blah - I'll detatil setup projects further at a later time)
Once this is done all of our files will go where we need them to go.  Unfortunately, your ASP app will still not be able to see the assemblies that you want unless you do a regasm.  Well, this is not true.  Before you build your setup projects, select the properties of you assemblies that you want to be visible to COM.  In their properties, set the Register property to have a value of vsdrpCPOM.  This will make the compiler add all of the necessary detail to the MSI package and make it effectively do REGASM for you.  You do NOT need to do anything else to make this happen.  All rather easy really.  :)

NOTE: To run REGASM, you need to have a string named key on the assmebly.  TO do this see the help on SN.EXE.

As an additional to this, should you want to perform all fo this without using an installer application, you can of course use the command line to do it (assuming all is nicely installed on the target server).  You should be able to locate REGASM.exe and GACUTIL.exe, these are all you need to use.

So, assume that you have an assembly in C:\MyStuff named JEFF.dll.  IN order to get your ASP pages to access it, type the following at the command prompt:

%WINDIR%\Microsoft.Net\Framework\v1.1.4322\RegAsm C:\MyStuff\JEFF.dll

%WINDIR%\Microsoft.Net\Framework\v1.1.4322\GacUtil C:\MyStuff\JEFF.dll

Job done.

Not quite...

double check that your webuser has sufficient permissions on the winnt/temp directory.

Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist
Heh, a slight addition to my previous post here.  Kinda feeling sheepish now.

My code worked frin for about 8 hours or su, until randomly, my client in question decided to switch date formats.  I can't really figure out why, but intermittantly, the thing calling my code will send 4/20/2007 or 20/4/2005.  This kinda sucks so I have to have another scurry around on google to see what I could find.  Basically, this article  by Amol Kulkarni here helped me out alot.

You have to be careful with XACT_ABORT I think, again - I'm not SQL guru and I'll need to read up on this.  It seems fairly similar to VB's 'On Error Resume Next' and as such could be quite dangerous if not handled correclty.

Either way, my lovely SQL code now caters for dd/mm/yyyy and mm/dd/yyyy looks like this:

Declare @DateTime varchar(50)
Declare @dtmDate datetime
Set @Datetime = '4/20/2007 12:03:56 AM'

Set XACT_ABORT OFF

Select @dtmDate = Convert(varchar, Convert(datetime, @DateTime, 103), 109)
If (@@Error <> 0) Select @dtmDate    = Convert(varchar, Convert(datetime, @DateTime, 101), 109)

Set XACT_ABORT ON

Print @dtmDate

Hopefully that's that end of it :)

Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist
One of the things I really find frustrating sometimes is working with dates.  I came along a problem recently where I was receiving a nicely formatted UK date (dd/mm/yyyy etc) and needed to pass it as a string over to another SP which may or may not accept that string formatting.  Son instead of 19/04/2007, I wanted to use something closer to April 19, 2007.

Every time I tried I was getting a DateTime conversion error.  When I've seen this problem before people have always talked about parsing the string and cutting it in to it's component parts.  Now, I'm no SQL guru but I was pretty sure that SQL server should be able to handle this in a better way.

Well, I think I may have found it.  SQL nicely give us a convert function.  A simple example of how to use it might be:

Declare  @myNumber   int
Declare  @myString   varchar(4)
Select   @myNumber   = 101

Select   @myString   = Convert(varchar, @myNumber)

Print    @myString

This would return a varchar with the value "101".  Simple enough.

Dates of course are much more complex as a string due to the (possibly insane) possible combinations of values.

I came across this page which explains some more setting you can use. So eventually, I managed to solve my problem thanks to this using the following (I've expanded this just for the sake of the example):

Declare  @in      varchar(50)
Select   @in      = '19/04/2007 14:04:54'
Print    'In > ' + @in

Declare  @date    datetime
Select   @date    = Convert(datetime, @in, 103) -- Deals with the dd/mm/yyyy and time
Print    'Out > ' + Cast(@date as varchar)

Print    'Final > ' + Convert(varchar, @date, 109) -- Basically a long date time format

Print    'Combined > ' + Convert(varchar, Convert(datetime, @in, 103), 109)

The output being:

In > 19/04/2007 14:04:54
Out > Apr 19 2007  2:04PM
Final > Apr 19 2007  2:04:54:000PM
Combined > Apr 19 2007  2:04:54:000PM

Hurray, problem solved (for me at least)

Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist
While I was geeking out as often happens reading up on some WCF I found this nice little blog about the next version of C#, .Net and Visual Studio.

Exciting stuff as it is, there is not too much to go on here.  I'm looking forward to finding out more about this in due time!

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

When working with a friend recently, we fell across a little problem with the default ASP.Net controls for membership.

The basic problem seems to be that someone somewhere decided that it would be a good idea to wrap everything in <table> tags and fill things with in-line styles. A lot of people on-line seem to be banging their heads over this and I myself spent quite a while looking about trying to find a solution.

I stumbled across this article on demarzo.net that seemed to have a nice fix for the Log-in control at least. It’s a bit of a hack, but hey, it works. It is simplicity itself, simply overriding the default Render method and stripping out the surrounding table.

This is all well and fine, but we then came to look at the CreateUserWizard. Oh my good Lord ! What a mess; tables and in-line styles everywhere. SO off we tootle again trying to figure out how to get rid of all of that. Again, demarzo helps us out with this by informing us of a new CSS release of the controls.

You can find the exact information here on the ASP.net site. If, like me you’re quite new to some of this, you may want to note the that at the top there is an ‘Examples’ link. Not although the examples really are Demos and not much more, there is a link to the white paper about how to use the CSS friendly adapters (this one helped me out a lot).


Bookmark with :
Digg It! DZone StumbleUpon Technorati Reddit Del.icio.us Newsvine Furl Blinklist
This is a brief introduction and gloss-over article about calling webservices directly in BizTalk messaging without using an orchestration.

It's something the I wanted to try out as a result of a training course when I though 'Hey, wouldn't it be cool if I could do that?'

Read my article on it here.


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