Author: Richard Seroter

  • BizTalk BAM Gotcha

    So I’ve built a “BizTalk For Business Analysts” class that I’m delivering next week to 20 or so of my new co-workers. We’re covering the basics of BizTalk, and I’ve built three lab exercises that deal with the Orchestration Designer for Business Analysts, using SharePoint/InfoPath with BizTalk, and building and consuming BAM models. When testing my BAM lab, I kept encountered a scenario where I deployed the BAM infrastructure, used the Tracking Profile Editor (TPE) to associate the orchestration with the BAM model, but for some reason, barely any data was getting captured.

    After trying a few things, I finally found the reason. I had built a partial orchestration (that the class will complete) that looks like this …

    The idea is that the class will fill in the shapes for each placeholder. Well, what I figured out was that every send/receive that was contained in a Group shape failed to get recorded. Now Stephen Thomas mentioned an issue with using a Group as the last shape in the orchestration (which I did NOT), and I haven’t seen anything noted about avoiding Groups altogether for BAM scenarios. The help docs mention that the Group shape can’t be used for tracking, so I decided to take it a step further and just flip all my Group shapes to non-transactional Scope shapes. Sure enough, now everything gets tracked. Good way to end a week.

    Technorati Tags:

  • My MS Replacement Hired, Other Musings, Certificate Help Needed

    So it looks like my Microsoft replacement has finally been hired. My buddy Chris Romp has taken over the role of BizTalk Technology Specialist for Microsoft SoCal. He’ll do a great job, but if any of my former customers are reading this, please give the poor guy a little time to get up to speed on the beast that is Microsoft!

    Other random BizTalk musings on my mind today (and a plea for help) …

    I wasn’t 100% sure at what point the ErrorReport for a Send port gets generated. That is, if a (send) port has 5 retries, does it wait until all those retries are exhausted? After a quick test, indeed, no ErrorReport is sent to the MessageBox until retries are done.

    Today for the first time, I had to send a message to a SharePoint library and DIDN’T apply the InfoPath declaration in the Xml pipeline. Instead, I wanted to see if sending the “naked” message to a SharePoint forms library (which had an InfoPath form associated with it) would still cause it to get opened with library’s template. Sure enough, it worked. I guess I knew it SHOULD work, but simply never tried.


    Anyone have success doing BizTalk message encryption/decryption using certificates created with the .NET makecert tool? I’m getting owned right now. I built a certificate (makecert -n “CN=CompanyCA” -pe -r -sv “c:\cert\CompanyCAPrivate.pvk” “c:\cert\CompanyCAPublic.cer”), installed the public certificate in the machine’s Other People store (for BizTalk to use when encrypting outbound messages). I then put the private key certificate in the BizTalk host account’s Personal store so that BizTalk could use it to decrypt inbound messages. I created send/receive pipelines with the necessary MIME encoding/decoding and picked the certificate at the right places (send port, receive host).

    When I send a file out from BizTalk, it shows up perfectly encrypted. However, if I drop that same file into a location for BizTalk to pickup and decrypt, I get “There was an authentication failure. ‘Failed to decode the S/MIME message. The S/MIME message may not be valid’.” After spending waaaay to long on this, I’m about to light myself on fire.

    Any thoughts?

    Technorati Tags:

  • Handling and Throwing SOAP Exceptions from BizTalk

    I’m building the “system qualification” applications for our new BizTalk Server 2006 environment, and one use case consisted of both consuming and exposing web services using BizTalk. Given that I frequently forget the process for handling SOAP exceptions, I figured I’d document it here for future reference.

    In this case, I’m receiving a message, using a message value to call a web service, and assuming everything goes fine, I construct a message response to the caller. I’ve wrapped my Send shape and Receive shape into a non-transactional Scope shape. This allows me to have exception handlers. In the exception handler below, I’m catching SOAP exceptions (found in System.Web.Services.Protocols.SoapException). I’ve created a message named “FaultMsgOutput” of type “string.” In the exception block I construct that fault string (FaultMsgOutput = “ProcessOrder.odx had a SOAP error occur!”) and send it out via a Fault operation method. If you have an inbound request/response port, you can add any number of fault messages.

    After building and deploying this project (and generating a web service using the Web Services Publishing Wizard), I had to remember to jump into the auto-generated send port and switch the Retries number to 0. Otherwise, BizTalk would retry the SOAP call a few times, while the original caller ends up with a timeout. This way, the exception is immediately returned to me in the orchestration.

    To test this, I built a small WinForm application to call the BizTalk generated web service. In the portion of the code where I call my BizTalk web service, I included the following “catch” statement …

    catch (System.Web.Services.Protocols.SoapException soapEx)
    {
    MessageBox.Show(soapEx.Detail.InnerText);
    }

    First I naturally executed a “standard” scenario with everything working. Next, I changed the web service that my orchestration calls to include the following line at the top of called method …

    throw new Exception(“bad inventory service exception”);

    Nothing too exciting. As expected, this exception was shown in my WinForm app was the text I typed in the “FaultMsgOutput” string message. Next, I went to the called web service in IIS, and changed the permissions. As I hoped, this error was also caught by my orchestration and gracefully returned to the initial caller.

    So, it’s fairly easy to catch web services exceptions, whether they are specific to the code itself, or infrastructure (e.g. IIS) related.

    Technorati Tags: ,

  • BizTalk 2006 Technical Articles

    So the BizTalk 2004 Technical Articles page is one that’s at the top of my browser’s bookmarks list. It’s still very relevant for BizTalk 2006 design/development. Today I bumped into the BizTalk 2006 Technical Articles page, which I swear hasn’t been there that long. Individually I’ve seen some of these white papers, just not all in one spot. Specifically, take a look at the scalability study for the SOAP adapter, and Doug’s paper on testing and evaluating BizTalk servers before going live. Even if you aren’t personally concerned with hardware capabilities, check out the sections labeled Basic Questioning and Detailed Questioning for topics you should bring up when scoping out and planning your BizTalk projects.

  • Synchronizing BizTalk Message Changes

    I was having issues with BizTalk’s promoted/distinguished fields today, so I ran a small test, and I’m not sure what I have here.

    What I want to see is when I change various values in a message (e.g. promoted property fields, distinguished fields, the message directly), when do the other values (e.g. promoted property fields, distinguished fields, the message directly) get updated? For instance, when I set a promoted value for a message, when does it get “pushed down”?

    I have a very simple BizTalk project with a schema, property schema, and orchestration. In the schema I have a field called Node1 and I have both distinguished and promoted that field (into a property field named RoutingNode). In my orchestration, I have a series of activities where I manipulate the message in all sorts of sinister ways. Construct Block #1 has the following code contained (I’ve subtracted most of my trace statements):

    SampleSchema_Output1 = SampleSchema_Input;

    //print out distinguished value, promoted value, and actual XML content
    System.Diagnostics.Debug.WriteLine(“Distinguished: ” + SampleSchema_Output1.Node1 + “; Promoted: ” +
    SampleSchema_Output1(BizTalk.Blog.MonitorMessageChanges.RoutingNode));
    xmlDoc = SampleSchema_Output1;
    System.Diagnostics.Debug.WriteLine(“XML content: ” + xmlDoc.OuterXml);

    //change promoted value
    SampleSchema_Output1(BizTalk.Blog.MonitorMessageChanges.RoutingNode) = “changed #1”;

    //print out distinguished value, promoted value, and actual XML content
    System.Diagnostics.Debug.WriteLine(“Distinguished: ” + SampleSchema_Output1.Node1 + “; Promoted: ” +
    SampleSchema_Output1(BizTalk.Blog.MonitorMessageChanges.RoutingNode));
    System.Diagnostics.Debug.WriteLine(“XML content: ” + xmlDoc.OuterXml);

    Got that? So I print out the current values stored in the distinguished field, promoted property field and then the whole message itself. Then I change the promoted property value, and print the whole thing out again. In Construct Block #2 I have the following code (all trace statements removed since you get the point):

    SampleSchema_Output2 = SampleSchema_Output1;//change distinguished value
    SampleSchema_Output2.Node1 = “changed #2”;

    So in that one I changed the distinguished field value. Finally, in Construct Block #3 I changed the underlying XML document itself:

    SampleSchema_Output3 = SampleSchema_Output2;xmlDoc = SampleSchema_Output3;

    //change xml directly
    xmlNode = xmlDoc.DocumentElement.SelectSingleNode(“/*[local-name()=’SampleSchema’ and
    namespace-uri()=’http://BizTalk.Blog.MonitorMessageChanges’%5D/*%5Blocal-name()=’Node1′ and namespace-uri()=”]”);
    xmlNode.InnerText = “changed #3”;

    So if you’re still with me, you may be interested in the results of this little experiment. What do you expect to be printed out after each Construct block? Here’s what I got:

    I don’t think I expected that. From that experiment, it looks like the XLANG message either updates itself automatically, or, when I request the values (like distinguished fields or promoted properties) it’s checking for changes. Did I do something off here, or does this seem right to you people?

    Technorati Tags:

  • BizTalk Article in Latest MSDN Magazine

    Very useful overview of the web services capabilities in BizTalk Server 2006 in this month’s MSDN Magazine. Aaron Skonnard focuses a good portion of the article on generating services, but also covers service consumption and WSE considerations. There’s a teaser paragraph at the end about upcoming the Windows Communication Foundation adapter included in BizTalk Server 2006 R2.

  • I Surrender .. BizTalk IS Affected by Daylight Savings

    Sigh. Ok, so BizTalk still isn’t affected by the changes to Daylight Savings this year, BUT, the Microsoft KB article has been updated to explain general quirks with daylight savings, and reveals a hotfix to be available this month.

    On the general Daylight Savings Microsoft page, you’ll see a note saying, in part, that:

    Although related to BizTalk Server’s handling of DST, these issues are not specific to DST 2007,

  • Add Namespace to Inbound BizTalk Messages

    Did you know that BizTalk Server has a hidden pipeline component that can add namespaces to inbound documents?

    Often, you’ll find that you’re retrieving XML data from a system where no namespace has been provided. This can cause issues for BizTalk Server given that namespace#root is the global unique identifier for messages. If you had installed the BizTalk Adapters for Enterprise Applications, you’d find a Visual Studio.NET project located at:
    C:\Program Files\Microsoft BizTalk Adapters for Enterprise Applications\Pipeline Component

    This is a custom pipeline component which adds namespaces to messages. For instance, let’s say I have the following XML input coming in …


    <InputSchema>
    <Node1>Node1_0</Node1>
    <Node2>Node2_0</Node2>
    </InputSchema>

    I can create a receive pipeline with my new SetNSForMsg custom pipeline component.

    Notice that I can type in a namespace that will be applied to the message. After deploying this pipeline and running the above message through, I get an output XML message looking like this:


    <InputSchema targetNamespace=”http://Blog.BizTalk.NSPipelineTest”&gt;
    <Node1>Node1_0</Node1>
    <Node2>Node2_0</Node2>
    </InputSchema>

    I stared at that for a few moments and something didn’t look right. I added an XML Disassembler pipeline to my receive pipeline and redeployed. Now when I processed the original message, it got suspended with a notice that an unrecognized format was received. I realized that the component is setting the targetNamespace value vs. setting up the xmlns value the message needed. So, I went into the provided custom pipeline component’s Execute method and changed the line message.DocumentElement.SetAttribute(“targetNamespace“, targetNS); to message.DocumentElement.SetAttribute(“xmlns“, targetNS);. So my current receive pipeline looks like this:

    My output messages now look like this:


    <InputSchema xmlns=”http://Blog.BizTalk.NSPipelineTest”&gt;
    <Node1>Node1_0</Node1>
    <Node2>Node2_0</Node2>
    </InputSchema>

    Now THAT’S what I’m looking for. Just to be sure that the disassembling actually succeeded, I stopped the send port, thus suspending the outbound message. Inspecting that message shows me that the Message Type was indeed set:

    Sweet. One final cool thing. Now that I have this pipeline, I can use the BizTalk Server 2006 feature to modify pipeline configuration settings for EACH receive location that uses it. You can reuse this pipeline over and over, and just modify the namespace value and document schema.

    While on the topic of pipelines, don’t forget to download Tomas’ fancy new PipelineTesting library for running unit tests on your pipeline components.

    Technorati Tags:

  • Now BizTalk is NOT Affected by Daylight Savings

    Ok … so in checking the Microsoft Preparing for Daylight Savings Changes in 2007 page, you’ll now see an update on Feb. 2nd that states:

    BizTalk Server entries removed after determination product not directly affected by DST2007 issues.

    So, my previous post is moot. You’ve got plenty of things to update, but now BizTalk Server isn’t one of them.

  • Upcoming Daylight Savings Patch for BizTalk Server

    So I see today that BizTalk Server (among many other applications) is affected by the whole screwy US Daylight Savings change for 2007. Specifically for BizTalk, you’ll find the statement “Microsoft Biztalk Server 2006: Final update will be available in March 2007 through CSS. For more information see KB article 931961 (to be published by January 26).” The KB article isn’t online yet, but any thoughts as to what is affected by the change? My money is on the “service windows” for ports. Off the top of my head, I can’t think of what else would care about the change. Other guesses before the KB article appears?

    Technorati Tags: