Archive for December, 2006

Web service times out before the orchestration completes

Wednesday, December 20th, 2006

Today we ran into some problems when making a call to a web service  that took more than 90 seconds via the SOAP adapter. After 90 seconds we got a ”System.Net.WebException: The operation has timed-out” error in return. It turned out that we had to set the SOAP.ClientConnectionTimeOut context property for the request message. We did this in the message construction using the following code.

MyRequestMessage(SOAP.ClientConnectionTimeout) = 200000;

I found this post by Thomas Restrepo useful for understanding both the problem and solution. Apparently the default value is 90000 (90 seconds) before the adapter times out.  This article on MSDN is also an excellent read when working with web services and BizTalk server.

How to set a custom file name using the file adapter in BizTalk

Friday, December 15th, 2006

Found this article on the code project on how to set a custom name on a output file - something I recently had to do. It also contains a list of all the macros that are available in the file adapter - so does this post from Owen Allen.

Advanced Microsoft BizTalk Server 2004 and Microsoft Operations Manager 2005 Scenarios

Friday, December 15th, 2006

Scott Colestock has a vary thorough article on TechNet about MOM 2005 and BizTalk. It’s really amazing what it possible to accomplish when one gets these two solutions to play together.

BOM - Byte Order Mark in BizTalk output

Wednesday, December 13th, 2006

Today was another day of new BizTalk problems … The task was easy; produce a XML file and send to a receiving system. Fine. Done. … Not.

The receiving system could not read the file because of some strange characters in the beginning of the file! It looked something like the below when opening the file in a fancy text editor (UltraEdit or TextPad for example).

<?xml version="1.0" encoding="utf-8"?>

After a couple of very interesting (:/) hours of Googling I found this from Ben McFarlin

It is because internal BizTalk messages are in UTF8 format and include
the byte order mark. When you added the xml declaration for UTF16 it
confused the engine; the declaration read UTF16 but the byte order mark indicated UTF8.

Preserve BOMWhen I finally found the cause the solution was easy. Just another of those weird properties …    This time it’s called Preserve BOM (on the properties of the XML Assembly pipeline component - see figure on the right). BOM of course stands for Byte Order Mark.

Gmail and Opera Mini on the phone!

Wednesday, December 13th, 2006

A couple of months ago I found the new Gmail mobile application. It’s a clean small Java application that one downloads to the mobile phone for accessing the Gmail account.

The application has easy access to almost all of the features that the ordinary web interface has. There was (and probably still are) an mobile version of the web interface but it didn’t have the easy access to all the different menus as this application has. I really like it and use it several times each day.

The supported devices are listed here and to get on your phone all you do is to visit this URL http://gmail.com/app with your device.

Another cool little application is the Opera Mini browser. These a full feature list here. Basically it transforms the pages so that they fit the mobile screen, and it’s fast! It also has some special features for navigation on small screens. And it supports RSS bookmarks!

Nevermind the XML namespaces in Xpath expressions

Monday, December 11th, 2006

Understanding Xpath expressions is definitely a success factor when working with BizTalk development. Xpath is extremely powerful (when one gets it right) but it’s one of the must frustration techniques I’ve ever worked with! Xpath is one of those languages that either gives you to answer you want to a query - or (more often) just doesn’t give you anything in return! In 99 percent of the cases this means that you missed something in your match. In 99 percent of these cases this means that you got some problems with namespaces in the XML document your querying (This is certainly true when working with BizTalk that “namespace-heavy”). One technique to get around this is to use the same approach as BizTalk itself uses - the Xpath local-name() function!

Consider the following XML document.

<Message xmlns:ns0="Standard.Envelope/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ns0:Envelope> <Header> <MessageTypeInfo> <MessageType>.</MessageType> </MessageTypeInfo> <Action>INSERTED</Action> <Addressees> <SenderCode>Mill</SenderCode> </Addressees> </Header> </ns0:Envelope> </Message>

The Xpath expression below will hit the Envelope node. But is’s very fragile! As soon as the namespace prefix changes (It might change to ns1 and namespace ns0 will be used for something else.) you’ll end up with an empty result.

/Message/ns0:Envelope

However, if one uses the below expressions instead - that makes use of the local-name function - it ignores the namespace and only cares about the name of the node (Envelope that is ;)). And this is of course far less sensitive to change.

/Message/*[local-name()='Envelope']

BizTalk Deploy Tool

Monday, December 11th, 2006

I’m currently working in a stabilization phase on a deployment application for BizTalk 2006 projects. We based the solution on the Enterprise Solutions Build Framework and the BizTalk Explorer Object Model. Basically our solution has a GUI that makes it possible to point out which artifacts one likes to deploy (from the developers local BizTalk server).

The application then figures out all the dependencies that the selected artifacts has (In our solution an Orchestration for example might have > 20 dependencies to different schemas, pipelines, C# libraries etc, etc). 

All DLL:s of the different artifacts are then extracted from the local GAC (where they exist when deployed to the local BizTalk). These DLL:s are then packed in to one single deployment package also containing a single XML file that keeps track of the dependencies and the order of witch they have to be deployed in BizTalk (the most depending schemas first and so on). The XML file also contains other meta data information such as ports the artifacts use etc.

This package is then loaded into another part of the application were it’s possible to point out the different servers one like to deploy to. This view then shows information about what has to be done on the server to make it possible to deploy without conflicts (One might have running Orchestration or suspended messages for example that has to be stopped or terminated.). At this stage we also check the naming of the different artifacts. These have to comply with the naming conventions that are configured in the config file of the applications (a warning is shown if the artifact doesn’t validate towards these).

When no warnings (its possible to override a warning) or conflicts are shown one can deploy. We then move the deploy scripts to the servers and use the MSBuild tasks in the SBF to deploy everything for us. We really saved some serious time with this approach and even if it took us a while to get everything working it’s been well worth it!

We have a huge feature list for the next phase of the tool and are planing to and support for BizUnit tests in the DLL:s (so that one gets a warning when deploying a Orchestration without etc). We also like to add more meta data about the port and make it possible to configure new ports as a part of the deployment process. Etc, etc …

Feel free to comment or write we line for further information about this approach. It would also be interesting to hear about other approaches for deployment and what kind of features these solutions have.

ARCast - Patterns and Anti-Patterns for SOA

Monday, December 11th, 2006

I’m a loyal ARcast listener and I think I’ve listened to most of the shows that ever been produced (at least those that are available in the archive). I also listen to a couple of other podcasts that are focusing on .NET and Microsoft techniques (for example .NET Rocks!) and in my opinion ARcast is by far the most rewarding (I guess this is both a matter of taste and depending on what kind of work one does.)! However these two shows on Patterns and anti-patterns for SOA (part 1 and part 2) really stands out!

They really got me thinking of a couple of anti-patterns the project I’m currently working on are stuck in. And Ron Jacob delivers (as always) the message with a lot of humor and enthusiasm. Recommended!

XML comment in BizTalk output message

Monday, December 11th, 2006

We ran into an issue today when we had to have an XML comment just below the XML declaration in a message we’re producing in our BizTalk 2006 solution. We needed to produce something like the below.

<?xml version="1.0"?> <!-- Comment goes here -->

Our first approach was to create a map in the send port and to have a custom XSLT template in there that added the comment before the whole transformation process started. We actually got this to work but it meant that we had to have a whole new map with a separate XSLT document in the project!

Eventually we found a property called Xml Asm Processing Instructions (highlighted in the figure - click it to view it in original size) on the XML assembly component (used in the standard XMLTransmit pipeline).

We just put the comment as a value in this property and we were done! No new artifacts or code! Just a weird property - typical BizTalk behavior!