Get free Windows Server 2008 & Windows Powershell Ebooks from Microsoft E-learning!

Windows Server 2008 e-book offer
The Microsoft Press Windows Server 2008 e-book offer includes excerpts from the following publications:

Introducing Windows Server 2008 (ISBN: 9780735624214),
by Mitch Tulloch with the Microsoft Windows Server Team

Microsoft Windows PowerShell Step by Step (ISBN: 9780735623958),
by Ed Wilson

Additional chapters from Introducing Windows Server 2008 will be added to the site periodically, so be […]

Ownership of BizTalk Server 2006 Profiler and Documenter transferred!

DarrenJ has taken ownership of BizTalk Server 2006 Profiler and BizTalk Server 2006 Documenter which are very handy to develop documentation for your applications and also assess orchestration performance metrics.
BizTalk Server 2006 Orchestration Profiler:
Creates CHM report files illustrating the level of coverage for specified BizTalk orchestrations. This tool can be run to gain a consolidated […]

Lists, Arrays and collections within BizTalk orchestrations

>
> **Update 2012-03-28**
Unfortunately the images for this post was lost in upgrade of the blog.
>
>

This post shows how it’s possible to create your own .NET class and then use this within your orchestration (as a variable) to work with typed lists – something that unfortunately isn’t supported out of the box in BizTalk orchestrations. Below is the class used to create a typed list for System.String objects.

<span class="kwrd">using</span> System;
<span class="kwrd">using</span> System.Collections.Generic;
<span class="kwrd">using</span> System.Text;

<span class="kwrd">namespace</span> Sample.BizTalkCollections
{
    [Serializable]
    <span class="kwrd">public</span> <span class="kwrd">class</span> StringList
    {
        <span class="kwrd">private</span> List<<span class="kwrd">string</span>> _list = <span class="kwrd">new</span> List<<span class="kwrd">string</span>>();

        <span class="kwrd">public</span> <span class="kwrd">void</span> Add(<span class="kwrd">string</span> item)
        {
            _list.Add(item);
        }

        <span class="kwrd">public</span> <span class="kwrd">int</span> Count()
        {
            <span class="kwrd">return</span> _list.Count;
        }

        <span class="kwrd">public</span> <span class="kwrd">bool</span> Remove(<span class="kwrd">string</span> item)
        {
            <span class="kwrd">return</span> _list.Remove(item);
        }

        <span class="kwrd">public</span> <span class="kwrd">void</span> RemoveAt(<span class="kwrd">int</span> index)
        {
            _list.RemoveAt(index);
        }

        <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">string</span> ToString()
        {
            StringBuilder builder = <span class="kwrd">new</span> StringBuilder();
            <span class="kwrd">foreach</span> (<span class="kwrd">string</span> item <span class="kwrd">in</span> _list)
            {
                builder.AppendLine(item);
            }

            <span class="kwrd">return</span> builder.ToString();
        }
    }
}

Notice that the class is serializable so BizTalk can serialize when dehydrating the orchestration to the database. We’ve also chosen not to extend the IList interface as we don’t want to expose all methods of that interface, but only the once we’ll really going use within our orchestrations.

This StringList class exists within the BizTalkCollections namespace where we have other classes for lists types with different datatypes (for example ObjectList, Int32List and so on). Below is a picture showing the structure of the Visual Studio project containing all the collections we current have implemented. This project and the BizTalk testproject is available for download here.

In the orchestration we then have set up a variable and type this to our StringList class within the Sample.BizTalkCollections namespace.

Also make sure the assembly with your collection class is installed in the GAC, otherwise you’ll end up with a FileNotFound exception saying

>
> Could not load file or assembly ‘Sample.BizTalkCollections, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7109528d5dbf986b’ or one of its dependencies. The system cannot find the file specified.
>
>

Then you can use the following code within your orchestration! Download the sample project and test it.

A really generic class

I’d really like for it be possible to create my own generic classes and then initialize these using something like the below.

genericList = Sample.BizTalkCollections.GenericList<System.String>();

However this isn’t possible as BizTalk orchestrations don’t seem to understand generic classes … If someone found a solution to this please let me/us know via the comments to this post.

Lists, Arrays and collections within BizTalk orchestrations

This post shows how it’s possible to create your own .NET class and then use this within your orchestration (as a variable) to work with typed lists - something that unfortunately isn’t supported out of the box in BizTalk orchestrations. Below is the class used to create a typed list for System.String objects.  
using System;
using System.Collections.Generic;
using System.Text;

namespace Sample.BizTalkCollections
{
[…]

Suspending Messages and Cleanup

Here’s another reminder to myself when writing BizTalk Adapters: When creating a receive-side
BizTalk adapter, you need to be extra careful about when you can release (clean up)
a message part data stream.

There are two particular scenarios that I’ve seen cause trouble for adapters when
trying to implement message suspension on submit failures:

1. You release the message part data streams too early. This mistake is very
easy to make when using the base adapter in the BizTalk SDK, because it is not
clear about when it is done processing a message. So what might happen is that you
end up releasing the data streams after the failed submit batch is done, but before
the suspension batch is committed, so that the messaging engine is left with a disposed
stream in the middle of an operation.
Be careful about ensuring you’re all clear before cleaning up after yourself.

2. Ensure that data streams are readable before suspending messages.

Another common error I’ve seen is using non-seekable streams as message part
data streams. When you first submit a message from your adapter, and it fails, it’s
very likely that the data stream has been partially or completely consumed during
submission (for example, by a disassembler component in the pipeline). If you have
a non-seekable data stream, and you simply take the same failed message as is and
submit it in a second batch to the suspend queue, it will fail, because the messaging
engine cannot read the entire message contents anymore to save them.

So if you find yourself in this scenario, be prepared to recreate the data streams after
the initial submission failed and before the second one.

Either of these problems can cause some really weird errors during processing including:

  • The Messaging Engine received an error from transport adapter “XXX” when notifying
    the adapter with the BatchComplete event. Reason “Exception from HRESULT: 0x80C0169C”.
  • The transport batch from adapter “XXX” has been rejected by the messaging engine because
    the batch is empty. Contact the adapter provider to find out why the transport batch
    is empty.
Technorati
tags: BizTalk, BizTalk
Adapters
Orchestration Profiler for BizTalk Server 2006 and BizTalk Documenter

Orchestration Profiler for BizTalk Server 2006 and BizTalk Documenter

Hi,


I’ve recently taken ownership of the source for the BizTalk Orchestration Profiler and BizTalk Documenter tools that Jason Birth originally developed, the documenter has worked fine with BizTalk Server 2006 but the Profiler was broken in a number of places.   I have just finished a new build of the Profiler which now works with 2006 and fixed a few other niggles, both tools are now available and I’m open to feature suggestions for both tools moving forward.


If you haven’t seen or used the tools before then do take a look – they are invaluable in many circumstances and I for one use them one way or another on every BizTalk engagement, the Profiler is here: http://www.codeplex.com/BizTalkOrcProfiler and the Documenter is here: http://www.codeplex.com/BizTalkDocumenter


Information on both tools is copy/pasted below from the respective CodePlex sites, enjoy!


BizTalk Orchestration Profiler


 Creates CHM report files illustrating the level of coverage for specified BizTalk orchestrations. This tool can be run to gain a consolidated view of orchestration tracking data for a specified period of time to help developers get an idea of how their orchestrations are being processed and how much coverage they are getting in their testing. In addition to simple coverage information the data presented helps to identify latency and code path exceptions by highlighting long running and error prone orchestration shapes which is key to effective performance testing.

The image below shows a sample of the coverage summary, at a glance you can see the percentage of overall coverage acheived upon an individual orchestration, if all of the shapes are touched as part of your orchestration then you will acheive 100% coverage, common reasons for not covering all shapes with an orchestration are not running tests that stress the error paths of your solution. This coverage summary also provides you metrics around execution duration of your orchestration easily identifying orchestrations that take a long time to execute.

profilerCoverageSummary.jpg

The image below shows the orchestration coverage in detail, shapes highlighted in green have been executed as part of your last test pass and any shapes not executed will be highlighted in red. This enables you to easily understand what parts of your solution have been tested and which parts have not and adjust your testing as necessary.

profilerOrchestrationCoverage.jpg

As part of the profiler report you can see the “Top 10 Least Successsfull” shapes and the “Top 10 Longest Running” shapes, understanding where time is being spent inside your orchestration is key to effective performance testing and has been proven on a number of instances to pinpoint poor orchestration design and coding which when resolved has dramatically increased overall performance. The key is to understanding exactly where time is being spent and this tool offers a no-code view into your running system.

profilerShapeDuration.jpg


BizTalk Documenter

Creates compiled help files for a given BTS 2006 installation. This tool can be run on an ad-hoc basis using the UI or from the command line as a post build/deploy task to create a compiled help file describing a BTS 2006 installation. It will compile: BTS Host configuration, Send/Receive port configuration, Orchestration diagrams, Schema and Map content, Pipeline process flow, Adapter configuration, Rule engine vocabularies and policies, More and publish them as compiled help files. Optionally you can embed custom HTML content and custom descriptions for all BTS artifacts to produce a more customized look and feel to the CHM output

This tool can be run on an ad-hoc basis using the UI or from the command line as a post build/deploy task to create a compiled help file describing a BTS 2K4 installation. It will compile:

BTS Host configuration
Send/Receive port configuration
Orchestration diagrams complete with any custom code
Schema and Map content
Pipeline process flow
Adapter configuration
Rule engine vocabularies and policies
More

and publish them as compiled help files or Word 2003 XML. Optionally you can embed custom HTML content and custom descriptions for all BTS artifacts to produce a more customized look and feel to the CHM output.

The screenshow below shows some of the information collected about an Orchestration, you can see what variables, maps, messages, ports, correlation sets, etc. that are used by a given Orchestration.

documenterOrchestrationInfo.jpg

The screenshot below shows further orchestration information which is collected, in this case we can see all of the inline code written by the developer for the orchestration, useful for code reviews and understanding a solution.

documenterCodeElements.jpg


 

debatr BETA and More

I enjoyed the “That Web 2.0 is all fizz and no substance” debate that took place at WebStock Mini last month (warning parental discretion is advised).

Cheeky comment by Philip from Xero (11mins in) “This is a Mac which is an inferior computer[sic] I hate Mac’s go read my blog”. I have noticed that Rod has armed all of his Xero team with Mac’s I guess it helps them sell on their Software as a Service message.

Great also to see Zef Fugaz has made the NZ finals of fullcodepress… condolences for John Lewis who didn’t make the cut! 

Better By Design has posted the videos from their recent CEO Summit as well there is a session on there by Sam Morgan that is certainly worth a look.

WebCast on Advanced Scenarios of WFRules

WebCast on Advanced Scenarios of WFRules

Kavita (Microsoft) will give a presentation this Friday (7/6/2007) about some advanced scenarios using rules with Windows Workflow Foundation.

During this presentation you will see screenshots of Acumen Business Rule Manager as an example of an advanced Business Rules solution!

The Rule Manager provides the additional functionality of Rule Authoring, Rule Repository Rule Verification & Validation. Only by empowering the business users with a complete business rules tool set, you will achieve a truly agile business policy that becomes transparent within your organization.

Here are the details of the Live Webcast:

Event Name: Webcast: Introduction to Windows Workflow Foundation Rules – Part II

Start Date: 7/6/07
Start Time: 1:30 PM (GMT-05:00) Eastern Time (US & Canada)
End Time: 3:00 PM (GMT-05:00) Eastern Time (US & Canada)
Audio conferencing: +1 (866) 500-6738
Participant code: 7545634
Presenter code: 9070863

Click on this link for more information regarding this Webcast

The thing they don’t tell you when integrating MOSS and Reporting Services

MOSS and reporting services integration……

After installing SQL2005 SP2 and SharepointRS.msi (Sharepoint ‘extensions’) you’re
left to do a ‘small’ amount of configuration. Basically telling the MOSS environment
where to find the Reporting Services Server.

Previously this has been a difficult step – almost a journey of discovery. Here’s
the answer.

From Central Admin->Web Application->Reporting Services Configuration Integration

From below the 1st box always gives grief – the label title and the description
seem to indicate different things.

So just to put this to bed – the Web that you have ReportingServices installed – point
off to the ReportService WebService – you’re good to go!

Failed Message Routing and Message Suspension

Failed Message Routing and Message Suspension

A long while ago, while BizTalk 2006 was in beta, I mentioned a
couple of things about the Failed Message Routing feature and how it related to adapters.
Turns out I was a bit off the mark, and wanted to leave this here in case I ever need
this information again :-).

A couple of weeks ago I spent some good time troubleshooting an adapter, and was able
to understand a bit better the relationship between this feature and an adapter’s
behavior. Indeed, as I initially stated, failed message routing depends
on the ability to suspend messages that fail the submission process.

What can make this a bit confusing is that the BizTalk Messaging Engine can decide
to suspend messages on its own without adapter intervention. In cases where this happens,
failed message routing will still work, even if the receiving adapter doesn’t actually
support suspending messages in an explicit way.

For example, under some configurations, when an XML message fails processing
in the pipeline because the XML Disassembler component rejects it, the Messaging Engine
will suspend the incoming message on its own [1]. When this happen, the adapter will
receive an status code in the batch results with the value BTS_S_EPM_MESSAGE_SUSPENDED
(0xc00001).

What’s interesting about this value is that it is a success status code;
so, from the adapter perspective, it looks as if the message submit operation completed
without errors. It can, however, be a little confusing if you’re not aware of this
behavior.

Other than this scenarios, if you want to fully support failed message routing with
your adapters, you still need to fully implement suspending messages (through IBTTransportBatch.MoveToSuspendQ()). 

[1] Unexpectedly enough, I haven’t seen this behavior with the Flat
File disassembler.

Technorati
tags: BizTalk
Server
, BizTalk
Adapters