Tuesday, November 25, 2008

Health and Activity Tracking returns incorrect results in BizTalk Server 2004 bug, is still present in BTS 2006

Last week, we discovered that the fixed bug in BTS 2004: Health and Activity Tracking returns incorrect results in BizTalk server 2004 hasn't been fixed in BizTalk server 2006 and R2.

Microsoft is currently developping a hotfix to patch the problem.

Estimated delivery: several weeks.

Friday, November 14, 2008

Assembler cannot retrieve document specification by using this type

This error message can mean one of two things:

1. You don't have a schema deployed with a typename that matches the instance document coming through the system.

2. You have more than one schema deployed that matches the typename. We do a lookup on typename and see two schema deployed and can't choose without user guidance which one to use.

The second condition actually happens more regularly than you would initially think. For example: If you use the webservices “add web reference“ a reference.xsd schema is added to your project and if this schema was already deployed on your system you now have two copies.

So how do you get around this issue? One option is to reduce to a single schema, but that's not always possible. Another is to go ahead and create a custom pipeline (send or receive depending on what you are trying to do). Drag in the assembler/dissasembler (eg. XML) and set the property "Document Schemas" explicitly to point to the typename you want. That way we don't do a look-up and your error magically disappears...

Another solution is to change the namespace of the reference.xsd schema...

(Source: http://blogs.msdn.com/scottwoo/archive/2004/06/07/150174.aspx)

Thursday, April 10, 2008

BizTalk Server 2006 Best Practices Analyzer

You use the BizTalk Server 2006 Best Practices Analyzer to automatically examine a BizTalk Server 2006 deployment and generate a list of issues pertaining to best practices standards for BizTalk Server deployments. The primary use of this tool is to examine BizTalk Server production and staging environments.
The Best Practices Analyzer performs configuration-level verification by reading and reporting only. The Best Practices Analyzer gathers data from different information sources, such as Windows Management Instrumentation (WMI) classes, SQL Server databases, and registry entries. The Best Practices Analyzer uses the data to evaluate the deployment configuration. The Best Practices Analyzer does not modify any system settings, and is not a self-tuning tool.
The Best Practices Analyzer is available as a Web download.

Tuesday, March 25, 2008

Microsoft BizTalk Adapter Pack

The BizTalk Adapter Pack (BAP) became available a couple of weeks ago. The BAP provides a robust and comprehensive out-of-the-box connectivity infrastructure to three major line-of-business (LOB) systems - SAP, Siebel, and Oracle Databases. The technology is based on the WCF LOB Adapter SDK and inherently relies on the core WCF concepts, principles, and classes implemented in the .NET Framework 3.5.

What’s in the BizTalk Adapter Pack?

  • SAP Adapter
  • ADO.NET Data Provider for SAP
  • Siebel Adapter
  • ADO.NET Data Provider for Siebel
  • Oracle Database Adapter

Read more on the MSDN-blog.

Thursday, February 28, 2008

Configuration File Corrupt

Recently, when i tried to open my BizTalk Adminconsole it got the following errormessage:

root element is missing (c:\Documents and Settings\UserName\Local Settings\Application Data\Microsoft Corporation\Microsoft BizTalk Server 2006\Microsoft.BizTalk.Administration.Snapin.dll.config)".

To solve this error, just delete the Microsoft.BizTalk.Administration.Snapin.dll.config file.
Next time the Adminconsole will recreate this configfile :)

Friday, February 22, 2008

Binding an orchestration to multiple receive ports

In the BizTalk Server 2006 Admin Console, it's only possible to bind 1 physical Receive Port to 1 logical (Orchestration-)Receive Port.
To bind multiple receive ports to an orchestration, you could follow these steps:
  1. Create multiple Receive Ports with their Receive Locations in the Admin Console,
    use friendly portnames, you need them to create an expression later on.
  2. In your Orchestration select your activating Receive Shape and configure the "Filter Expression" by clicking the ellipsis. In the Filter Expression add as many "BTS.ReceivePortName"-properties as Receive Ports you have created.
    Set the values of the properties to the portnames of the Receive Ports and group each row by "OR".
    The Filter Expression should resemble something like this:
    (BTS.ReceivePortName == "ReceiveMsgPort1") (BTS.ReceivePortName == "ReceiveMsgPort2")
  3. Create an Orchestration Receive Port and specify its binding to "Direct Binding", also make sure "Routing between ports will be defined by filter expressions on incoming messages in the Messagebox database" is selected.
  4. Make sure that the "Partner Orchestration Port"-property of your Orchestration Receive Port is set to "Message Box".
  5. Now deploy your Application, all the messages which originate from the filtered ports will be processed by the Orchestration.

Tuesday, February 19, 2008

BizTalk Documenter, BizTalk Orchestration Profiler & BizUnit

Three tools every BizTalk-developer should be aware of, are BizTalk Documenter, BizTalk Orchestration Profiler and BizUnit. The documentation below is copied from the homepages of these tools.

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, … 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.
Get it: http://www.codeplex.com/BizTalkDocumenter

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.
Get it: http://www.codeplex.com/BiztalkOrcProfiler

BizUnit
BizUnit enables automated tests to be rapidly developed. BizUnit is a flexible and extensible declarative test framework targeted that rapidly enables the automated testing of distributed systems, for example it is widely used to test BizTalk solutions. BizUnit is fully extensible. Its approach is to enable test cases to be constructed from generic reusable test steps, test cases are defined in XML which allows them to be auto-generated and also enables the fixing up of URL’s for different environments, e.g. test, staging and production environments. Defining test cases in XML enables test cases to be auto-generated.
Get it: http://www.codeplex.com/bizunit

Tuesday, February 12, 2008

Master Secret Server not available

When configuring BizTalk, you might bump into this error: "Cannot perform encryption or decryption because the secret is not available from the master secret server".

A simple way to solve this problem:
  • Open a command prompt
  • Navigate to C:\Program Files\Common Files\Enterprise Single Sign-On\
  • Type in this command:
    ssoconfig -restoresecret SSO3F38.bak (or another file that looks like this one, it's the SSO back-up file)
  • Enter the password
  • Create a new back-up file with this command:
    ssoconfig -backupsecret latestbackup.dat

Tuesday, February 5, 2008

Sending a mail with an attachment & body text

To send an email-message that has attachment and also has a bodytext you need to work arround a few issues.
Normally you would create a send pipeline with a MIME encoder and set the "send body part as attachment" to True. This however, will cause your email bodytext to state "This message has attachments.", no matter what you've set to be the SMTP.EmailBodyText-value.
To work arround this issue, you have to take the following steps:

  1. Create a custom send pipeline and add a MIME encoder, leave this as is.
  2. In your orchestration view, create a new MultiPartMessageType with 2 Message Parts, a BodyPart and an AttachmentPart. Set the "Message Body Part" property to respectively True and False. Also, set the "Type" property of the BodyPart to the schema of the message you want to add as an attachment.
    The "Type" property of the AttachmentPart should be a .NET Class called "RawString".
    This is a custom class that contains the following code:

using System;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using System.Runtime.Serialization;
using Microsoft.XLANGs.BaseTypes;
namespace Microsoft.Samples.BizTalk.XlangCustomFormatters
{
public abstract class BaseFormatter : IFormatter
{
public virtual SerializationBinder Binder
{
get { throw new NotSupportedException(); }
set { throw new NotSupportedException(); }
}
public virtual StreamingContext Context
{
get { throw new NotSupportedException(); }
set { throw new NotSupportedException(); }
}
public virtual ISurrogateSelector SurrogateSelector
{
get { throw new NotSupportedException(); }
set { throw new NotSupportedException(); }
}
public abstract void Serialize(Stream stm, object obj);
public abstract object Deserialize(Stream stm);
}
public class RawStringFormatter : BaseFormatter
{
public override void Serialize(Stream s, object o)
{
RawString rs = (RawString)o;
byte[] ba = rs.ToByteArray();
s.Write(ba, 0, ba.Length);
}
public override object Deserialize(Stream stm)
{
StreamReader sr = new StreamReader(stm, true);
string s = sr.ReadToEnd();
return new RawString(s);
}
}
[CustomFormatter(typeof(RawStringFormatter))]
[Serializable]
public class RawString
{
[XmlIgnore]
string _val;
public RawString(string s)
{
if (null == s)
throw new ArgumentNullException();
_val = s;
}
public RawString()
{
}
public byte[] ToByteArray()
{
return Encoding.UTF8.GetBytes(_val);
}
public override string ToString()
{
return _val;
}
}
}

  1. Then in a message assignement shape, type the following expression:
    (POMessageOut is the outgoing message, POMessageIn is the message you want to attach).

POMessageOut.BodyPart = new Microsoft.Samples.BizTalk.XlangCustomFormatters.RawString("This is the body of the email.");
POMessageOut.AttPart = POMessageIn;

  1. That's pretty much it!

Monday, February 4, 2008

Working with the SQL Adapter (Tutorial)

Ever wondered how to work with the SQL Adapter in BizTalk? Below is a complete tutorial to teach you about it! It contains parts about retrieving information, polling the database, updating the database and debatching the results.

Download the file.