May 21st, 2008 Scott
I have been working on building a BizTalk solution for processing EDI transactions. These transactions needed to be processed through a Value Added Network (VAN) and AS2 was chosen as the protocol for communicating with the VAN. I spent a fair amount of time combing through the BizTalk documentation and many blog posts in order to get the AS2 bits properly configured. I am going to run a series of posts over the next week or so in order to capture this information so that I can easily access it next time I need to configure an AS2 system. I plan on covering all aspects of AS2 configuration including setting up the receiving endpoint in IIS, generating and installing the security certificates, setting up trading partner profiles and setting up a BizTalk application with the proper settings for send and receive ports. I hope this series will be useful for anybody else who is setting up an AS2 connection in BizTalk for the first time.
Update: I’ve added some additional external links that explain some of the technologies and acronyms used in this post.
Posted in BizTalk, EDI, Technology | 2 Comments »
May 17th, 2008 Scott
Today was the Cleveland Day of .NET conference and I had a wonderful time hanging out with other .NET geeks in Northeast Ohio. The event took place at the Hilton Cleveland East Beachwood Hotel. The conference consisted four tracks, and each track had seven sessions covering topics ranging from ASP.NET MVC to WCF security. While everything is still fresh in my memory I wanted to jot down my impressions of my favorite sessions. Out of the seven sessions I attended, there were three that really stood out as being my favorites.
- Test-Driven Development with ASP.NET MVC – This session was conducted by Alan Stevens was nice concise introduction to the magic of TDD and how the ASP.NET MVC framework helps to make doing TDD with web application development easier. I was already familiar with TDD, but I enjoyed seeing an introduction to the MVC framework and how it has been designed with testing in mind. Plus, Alan was an excellent presenter. I was also intrigued by how similar the MVC framework is to Ruby on Rails.
- Designing for Change: Inversion of Control and Dependency Injection – The presenter for this session was Nate Kohari, a fellow resident of Akron. His presentation introduced the how and why of using a dependency injection framework and featured Nate’s own DI project, Ninject. Being a BizTalk developer, I do not get many chances to work with something like DI, but I feel like I have a better grasp on what DI is and when I would choose to use it. Despite Nate’s claim of being a rookie presenter and a small glitch with the projector, this was another excellent session.
- Project Astoria and the Semantic Web – This was my favorite session of the day. The presenter was Chris Woodruff, and he discussed what Project Astoria (aka. ADO.NET Data Services) is and what can be done with this new data services framework. In a nutshell, Astoria is used to wrap and expose a data source as a web service. From a systems integration standpoint, this framework looks very promising as a way of quickly exposing legacy data sources as web services. From there it should be a fairly simple matter to then consume those services inside of a BizTalk application. I really want to setup a testing VMware image to try out this idea.
So once again, I had a fabulous time at Cleveland Day of .NET, and I hope they put it on again next year. I want to send out a big “Thank You!” to all of the people who worked to organize, present and sponsor this event. Who knows, maybe next year I will submit a topic and do a presentation myself.
Posted in .NET, Technology | Comments Off
May 14th, 2008 Scott
I previously talked about using XPath expressions in an orchestration in BizTalk Mapping Tips 01. I have recently discovered that you do not always want to wrap your XPath expression within a string() function. You only want to use the string function when you want to retrieve the text value of an XML node. You want to omit the string function if you are trying to set the value of an XML node.
So, to get a value you want your XPath expression to look something like this:
myVar = xpath(myMessage, "string(/*[local-name()='MyRootNode'])”);
To set a value, your XPath expression should look something like this:
myVar = xpath(myMessage, "/*[local-name()='MyRootNode']”);
Posted in BizTalk, Technology | Comments Off
May 12th, 2008 Scott
Here is a handy little mapping trick I happened to stumble over. In BizTalk 2006 and later, if you are using a map from within an orchestration you can use multiple input schemata and map them to a single output schema. For example, you can combine a source XML file with the results from a web service call and map them into a single destination schema.
To accomplish this, you will need to define a message for each schema inside of the orchestration. From there, double click on a transform shape in the orchestration designer. On the transform configuration screen, choose to configure the source messages and add a row to the list for each input message you want to add to the map. In my example you can see I have added a row for MySource and OtherData schemata.

Then define the destination message and check the “Open map in editor” box before clicking OK. The map editor will open, and you should see all of your input schemata defined on the left side of the map editor.

From there you can drag links to nodes and use functoids as you would for any other map. Note you can also use this setup to configure multiple destination schemata.
Posted in BizTalk, Technology | Comments Off
May 9th, 2008 Scott
I have been doing a fair amount of EDI mapping on my latest gig, and I wanted to share a neat trick I figured out for mapping 856 Advanced Shipping Notice transactions. What makes an 856 special is that all of the action takes place in one looping segment that contains a number of child segments. The fun part is that you need to use a different subset of those child segments in each loop iteration. For example, the first iteration you need to map data to the PRF, DTM and N1 segments. The second and third iterations map data to the LIN, SN1 and PID segments. The final iteration maps data to the TD1, TD5 and SAC segments. Anybody who has used the BizTalk mapper realizes that to map something like this you can not just drag a link from the source schema to the destination schema in the designer.
My solution to this problem came to me when I figured out that you can declare variables inside of one scripting functoid, and manipulate them from within another scripting functoid. I use two scripting functoids along with a looping functoid to control the number of loops that are created in the destination instance. The first scripting functoid contains the following C# code:
int _counter = 1;
public string Increment()
{
_counter += 1;
return "";
}
This code declares the loop counter, and increments it for each loop iteration. The second scripting functoid contains this code:
public int GetCounter()
{
return _counter;
}
This code returns the current value of the loop counter to the other mapping elements. Now you might be wondering why I did not combine the code into a single functoid. That is what I initially tried to do, but I discovered that for every output link, the scripting functoid evaluates its code. This causes all kinds of strange things to happen inside of the map. By separating the code into two functoids, I can control when the counter gets incremented.
To finish up our 856 map, we combine the loop counter with a set of logical functoids that will determine which nodes get mapped during each loop iteration. The logical functoids can be used to test for a specific loop iteration, or used to test for a certain range within the loop iterations. By dragging output links from the logical functoids to the segments that need to be mapped for the respective iteration, the segments will be created when the functoid evaluates to true and will be suppressed when the functoid evaluates to false. From there you can map the rest of the data using whatever combination of links and functoids works best. In the end you end up with a map that looks something like the image below. (Click on the image for a bigger version.)

Do you have questions? A better way of solving this problem? Please share it by leavinga comment.
Posted in BizTalk, EDI, Technology | 10 Comments »
May 7th, 2008 Scott
Just wanted to share a little bit of BizTalk trivia. BizTalk 2006 added the ability to create separate applications. For somebody with a programming background, like myself, a Biztalk application is conceptually very different from, say, a .NET application. A .NET application runs inside of its own process and has its own memory space. A BizTalk application is more of an organizational tool. It provides a convenient way of grouping together BizTalk artifacts, and makes it easier to stop and start a group of ports. However, all BizTalk applications are run within the same process.
That little bit of background information makes explaining this next part easier. Since everything runs in the same process, you have to be a little bit careful when you share artifacts between applications. For example, if you have two orchestrations that both use the same schema, you need to be sure that only one version of that schema is deployed. (Based on the XML namespace and the root node name combo that BizTalk uses to uniquely identify a schema.) If you deploy the same schema more than once, BizTalk will have trouble matching an instance to the correct schema and you will get all kinds of weird errors in the Event Log.
To avoid this problem, make sure you organize your shared artifacts into separate assemblies, and have the projects that use them all reference those assemblies. This is also nice, because if one of your shared schemas needs to be modified it only needs to be modified in one assembly, and then all the projects that reference it will get those changes. You might also consider deploying shared artifacts into a separate application to make it easier to keep track of them. (The default “BizTalk Application 1″ that gets created during installation is a good candidate for this.) Hopefully this little tip will help others who are new to BizTalk avoid some of the pain that comes with the large learning curve.
Posted in BizTalk, Technology | 2 Comments »
May 5th, 2008 Scott
Wow. Microsoft has announced another “R” version of BizTalk 2006. Check out that link for a rough list of the improvements coming with the R3 release. While on one hand I love getting new developer tools, on the other hand this will be the third BizTalk release in almost as many years. On top of that, you have BizTalk “Oslo” waiting in the wings. BizTalk is the most expensive of the retail products that Microsoft sells. The Enterprise version costs $35,000 per processor, so for a typical dual-processor server it costs $70,000 to deploy BizTalk. If your project requires more than one BizTalk server, the costs can get real expensive in a hurry. Each “R” release is treated as a new product, and is sold at full price. In my opinion, the functionality introduced in R2, and what is tentatively announced for R3 should have been released in a service pack. In essence, these rapid-fire BizTalk releases seem to be a ploy to force customers to purchase Software Assurance coverage for their BizTalk licenses. For early adopters of other Microsoft products, SA is a complete waste of money because the coverage usually expires before a new version is released. With the current BizTalk release cycle, you get completely hosed if you do not purchase SA, because there is a chance that two or more releases will happen during the SA coverage time period. I guess it is a good racket to be in if you can get away with it.
Posted in BizTalk, Technology | Comments Off