New White Papers…

We’ve been at it again.  If you haven’t seen these, check out these new white papers:



  • BizTalk Server 2004: A Messaging Engine Overview. This document describes the architecture and internal workings of BizTalk Server 2004 as a messaging engine.
  • BizTalk Server 2004 and Web Services. This paper discusses how BizTalk Server 2004 supports the use of Web services in building solutions.
  • Transactions Across BizTalk Server 2004. This document details transactional characteristics of BizTalk Server 2004 and how they apply across components, such as messaging, pipeline, and orchestration. It also describes how to construct business processes to guarantee message delivery.
  • Working With BizTalk Adapter for SQL Server. This document provides general knowledge about the BizTalk Adapter for SQL Server. It gives suggestions about when to use the SQL transport and how to retrieve, insert, update, and delete data. It also includes code samples

Tech-Ed Announcements – BizTalk 2006 Launch

A lot of folks heard at the Tech-Ed Keynote address on June 7 that we will have a joint launch of Visual Studio 2005, SQL Server 2005 and BizTalk Server 2006 on November 7, 2005.


Please do NOT confuse this with the RTM (Release to Manufacturing) date of BizTalk Server 2006.  BizTalk Server 2006 is still scheduled to RTM during the 1st Quarter of 2006.   November is just when the Joint  Launch “Party” will take place

“Completed with discarded messages” again

Yesterday some customers told me that they were suffering from “Completed with discarded messages” in an orchestration using the sequential convoy. They asked me how to solve.
I heard from other customer about the same issue last year. I think it is the one of the most frequent problems customers encounter when they use the “convoy” for the first time.
You can find a great article about the issue, “Completed with discarded messages”, from here. The post wrote the cause of the problem into 3 categories. The case I heard yesterday could be categorized into the 2nd one, which is “Sequential convoys with non-deterministic endpoints”.
Anyway, I wrote a sample code for the customer as following:



The basic idea is very simple. The customers can insert their orchestration into “Foo Process Msg”, The listen shape of “Check Msg for preventing it from being discarded” checks the work queue again before termination. It could prevent the message, which has arrived while processing the customer’s logic, from being discarded. And you can find the sample code here.


Thanks,
Young

BizTalk 2004 "Commando" Training course – BETTER Dynamic Mapping

I just posted a pretty cool sample of how you could call a map dynmically in C#.   Very nice.  However, it has a drawback (besides being officially unsupported).  


Specifically, the way I used TransformBase in the sample will result in regenerating a dynamic assembly for the xslt every time the code is executed. We’d run out of memory very quickly.


Here’s the solution.  One of our engineers, Yossi Levanoni, created the Metadata classes that basically cache everything there is to cache for any of the XLANG artifacts, including maps.  


By replacing these lines of code:


    Assembly mapAssembly = Assembly.LoadWithPartialName(“EAISchemas”);
    Type mapTypeClass = mapAssembly.GetType(“EAISchemas.MapToReqDenied”);
    
    TransformBase map = (TransformBase)System.Activator.CreateInstance(mapTypeClass);
    XslTransform transform = map.Transform;
    XsltArgumentList argList = map.TransformArgs;


With this :


   using Microsoft.XLANGs.RuntimeTypes;


    XslTransform transform = TransformMetaData.For(typeof(EAISchemas.MapToReqDenied)).Transform;
    XsltArgumentList argList = TransformMetaData.For(typeof(EAISchemas.MapToReqDenied)).ArgumentList;


Will result in the maps being pulled from our Cache rather than from the Assembly each and every time….


Pretty cool stuff!

Fun with ConfigFramework (updated)

I’ve been playing around with a funny error message in ConfigFramework. It says “The Operation Completed Successfully“, but it’s a Retry/Cancel message box, where you get looped until you press cancel… The details found in the log file talk about failiure to modify a COM+ Application. It also happened to a colleage, as he has posted more details in his eXtreme.NET blog.


I solved it changing the identity of MSDTC to the Network Service system identity and restarting MSDTC (I also relaxed the security allowing remote administration of MSDTC, but I’m not sure if it helped). Anyways, I think you can change these settings back to the old values after running ConfigFramework, since the error is about creating and configuring the COM+ App, not about running it.


update: this “The operation completed successfully” translates to “Connection with the transaction manager was lost”. So it’s in deed a problem of servers communicating via MSDTC. My concrete case is due to use local accounts for MSDTC identity in a workgroup environment, so the servers cannot authenticate each other. This case is documented in Bug: MSDTC Fails to Mutually Authenticate


Helpful articles: in case you want more documentation:


New DTC Functionality in Windows Server 2003 SP1

FIX: The SqlConnection.Open function generates a ComException error message if the Distributed Transaction Coordinator (DTC) service is restarted or failed over

Turning Off Remote Procedure Call Security on Windows 2003 Server


 


Here’s the pic, just for curious ones:

BizTalk 2004 "Commando" Training course – Dynamic Mapping

Every wonder how you could possibly reuse the XSLT that we store in BizTalk maps?   Every wonder how you could pick and chose which map to execute in your code from the compiled BizTalk Assembly.   Well there is a way!  The type containing the map xslt is devired from TransformBase contained in Microsoft.XLANGs.BaseTypes.  We can use that object to extract the xslTransform and the xslArgumentList objects from the BizTalk Map Type residing in the assembly and pass them to TransformMessage.   Pretty cool.   This allows you to resuse BizTalk maps and call them dynamically as you see fit.  For example, imagine the case of dynamic send ports where you also need to determine the map execution model dynamically or through a set of rules.  Remember though, this is completely Unsupported by Microsoft.


I put together a simple project from the shipped EAISolutions tutorial.  I added the EAIUtilies project to it which has the code for this.  This code is then called within a message assignment shape within the EAIOrchestration project to create a new message from the executed map.  Thanks Ashwani for helping me troubleshoot.


Download the project ..Check it out..


sing System;
using System.Xml;
using System.Xml.Xsl;
using Microsoft.XLANGs.BaseTypes;
using System.Reflection;
using System.IO;
using System.Text;
using System.Xml.XPath;



namespace EAI.Utilities
{
 /// <summary>
 /// Summary description for Class1.
 /// </summary>
 [Serializable()]
 public class MapHelper
 {
  public MapHelper()
  {
  }
  public static XmlDocument GetMappedDoc(Microsoft.XLANGs.BaseTypes.XLANGMessage msg)
  {


   XmlDocument xmlDocOutputMsg = new XmlDocument();
   XmlDocument xmlDocInputMsg = null;
     
   try
   {
    xmlDocInputMsg = (XmlDocument)msg[0].RetrieveAs(typeof(XmlDocument));


    Assembly mapAssembly = Assembly.LoadWithPartialName(“EAISchemas”);
    Type mapTypeClass = mapAssembly.GetType(“EAISchemas.MapToReqDenied”);


    TransformBase map = (TransformBase)System.Activator.CreateInstance(mapTypeClass);
    XslTransform transform = map.Transform;
    XsltArgumentList argList = map.TransformArgs;
   
    xmlDocOutputMsg = TransformMessage(transform,argList,xmlDocInputMsg);
      
   }
   catch (Exception exc)
   {
    System.Diagnostics.EventLog.WriteEntry(“mapHelper”,exc.InnerException.ToString());


   }
   return xmlDocOutputMsg;


  }
  private static XmlDocument TransformMessage(XslTransform xslt,XsltArgumentList args,XmlDocument sourceDoc)
  {
   XmlNodeReader sourceRoot=new XmlNodeReader(sourceDoc);
   XPathDocument srcXPath=new XPathDocument(sourceRoot);
   MemoryStream stm = new MemoryStream();


   XmlTextWriter writer = new XmlTextWriter(stm,System.Text.Encoding.Unicode);


   xslt.Transform(srcXPath,args,writer,null);


   stm.Flush();
   stm.Seek(0,SeekOrigin.Begin);
   
   XmlTextReader destReader;
   XmlDocument destDoc;


   try
   {


    destReader= new XmlTextReader(stm);
    destDoc = new XmlDocument();
    destDoc.Load(destReader);
    return destDoc;


   }
   finally
   {
   }
  }
 }
}


 

Exception occurred when persisting state to the database…..

The chance that you receive this error for the same reason as I may be slim, but I thought I would offer up anyway.  If you receive this error, and read the entire error message in the event viewer, it should give an indication of the cause.  In my case, this was “no subscribers were found”.  Of course I headed to our fried the Subscription Viewer.  What I discovered is that when you enlist a dynamic send port, it creates a subscription for every adapter you have registered.  In my case I had gotten a little ahead of myself and had deployed a project with an orchestration that made use of a custom adapter that I had registered AFTER deploying the orchestration project.  To be safe, I undeployed the orchestration project, registered the adapter, and redeployed the orchestration project.  All is good.


 


Cheers,


Todd

Compiled BizTalk 2004 Help File (.chm), indexed with MSN Desktop Search

Marty Wasznicky has posted a compiled BizTalk 2004 Help File (.chm) check it out in his blog (11 Mb)


The most interesting stuff is that it can be indexed using MSN Desktop Search (as any other .chm file)…. that means querying BizTalk Documentation from the Windows Taskbar. Cool, since I’ve tried to index the Visual Studio Combined Help files without success 🙁