BizTalk BRE Pipeline Framework v1.5 now available for download from CodePlex

BizTalk BRE Pipeline Framework v1.5 now available for download from CodePlex

I have just released av1.5 of the BRE Pipeline Framework to the CodePlex project page. This is a feature rich and heavily optimized version of the framework with much richer traceability as well. A breakdown of new features and improvementsby category is below. Qualitative features Now supports BizTalk Server 2010, 2013, and 2013 R2 (note […]
Blog Post by: Johann

Getting the SSO Application Configuration MMC to work with BizTalk 2013 R2

Getting the SSO Application Configuration MMC to work with BizTalk 2013 R2

BizTalk Server 2013 R2 is finally here and it’s time to go through the fun/pain of upgrading environments and getting everything back into a working state all over again. Last year I wrote a blog post about getting the SSO Application Configuration MMC to work with BizTalk Server 2013, seeing as Microsoft hasn’t published updated […]
Blog Post by: Johann

BizTalk 2013 R2 is available for MSDN subscriber

BizTalk 2013 R2 is available for MSDN subscriber

What’s new in BizTalk Server 2013 R2: Windows Server 2012 R2, Windows Server 2012, Windows 8.1, Windows 7 SP1. Microsoft Office Excel 2013 or 2010. .NET Framework 4.5 and .NET Framework 4.5.1 Visual Studio 2013 SQL Server 2014 or SQL Server 2012 SP1 SharePoint 2013 SP1 WCF-WebHttp adapter now supports sending and receiving JSON messages. […]
Blog Post by: Jeremy Ronk

Failed to Validate BAM Portal Web Site (BAMPortal)

I have recently encountered an error while trying to reinstall BAM Tool and the BAM Portal on a Microsoft BizTalk Server 2013 installation. I encountered the following error while attempting to configure the BAM Portal in the Microsoft BizTalk Server Configuration window.

The error specific error encountered when clicking on the red validation icon is:

Failed to […]
Blog Post by: Kevin Morillo

Tweet, Comment, or Post Your Way to One of 12 Great Prizes!

Time is running out to enter my contest to win one of 12 great prizes!

To enter, simply take a look at my new PowerShell scripts located here:

  • Single Server Microsoft Azure BizTalk 2013 Developer Edition Setup Scripts
  • Domain Microsoft Azure BizTalk 2013 Enterprise Setup Scripts

Then Tweet, Comment, or Post your way to a prize! 

You do not need to run the scripts or do anything to enter!  Just leave a comment, tweet, or post to Facebook.

You can enter through each method below but only one prize per winner.  The $100 prize if for the best review of the PowerShell Scripts but the other 11 prizes will be selected at random.

1. Enter via Twitter – Tweet your comments / entry.  Ensure to include @StephenWThomas and the hash tag #msbts.  It’s that easy. 

2. Enter via Facebook – Like BizTalkGurus on Facebook if you don’t always.  Post a comment to our wall. 

3. Enter via a Comment on either Single Server or Domain PowerShell download pages above.  If you comment on both, only one will count.  Just post a comment to one of the links above.

The contest ends on June 30th at 11:59 PM CST.

Prizes

$100 cash brought to you by BizTalk360

5 30-day Pluralsight Subscriptions – $30 value.
You could use your subscription to watch my courses on “
What’s New in BizTalk Server 2013” or my new course “Into to BizTalk Server 2013 ESB Toolkit” that will be available soon.

6 “Getting Started with BizTalk Services 2013” eBooks – $15 value.

If you do not win the book, you can buy it at
Packt or at Amazon.
This is one of those books that every BizTalk Developer should own.

Good luck.

BizTalk Server 2013 R2 Now available to be downloaded

BizTalk Server 2013 R2 Now available to be downloaded

BizTalk 2013 R2 is finally here and can be downloaded from MSDN Subscription.

What’s new in BizTalk Server 2013 R2:

  •  Windows Server 2012 R2, Windows Server 2012, Windows 8.1, Windows 7 SP1.
  • Microsoft Office Excel 2013 or 2010.
  • .NET Framework 4.5 and .NET Framework 4.5.1
  • Visual Studio 2013
  • SQL Server 2014 or SQL Server 2012 SP1
  • SharePoint 2013 SP1
  • WCF-WebHttp adapter now supports sending and receiving JSON messages.
  • SFTP adapter now supports two-factor authentication
  • HL7 Accelerator now supports the following:
    • Provides capability to include free-text data as part of the message that can be processed by the HL7 pipelines.
    • 64-bit support for hosting Hl7 adapter.

Good luck, and play around with it.. Again, you can download it through MSDN Subscription here

BizTalk: Applying Custom XPath to Promoted Property results in ’XPath in wrong format’

Well
not a bad one to track down and basically from reverse engineering the Microsoft.BizTalk.Pipeline.Comonents.dll your
xpath expressions need to be in the a ‘certain format’ even though the traditional
Xpath tools work beautifully.

I
was dealing with some HL7 messages so my call stack maybe slightly different to yours
– but it’s something like:

Fatal
error encountered in 2XDasm. Exception information is Microsoft.BizTalk.Component.ComponentException
at Microsoft.BizTalk.Component.XPathHelper.CheckXPathExpression(String strXPath)
at Microsoft.BizTalk.Component.XPathDenormalizer.Denormalize(String xpath, Boolean
bAbsolute, Boolean bGetChildNodes)
at Microsoft.BizTalk.Component.XmlDasmReader.CreateReader(IPipelineContext pipelineContext,
IBaseMessageContext messageContext, MarkableForwardOnlyEventingReadStream data, Encoding
encoding, Boolean saveEnvelopes, Boolean allowUnrecognizedMessage, Boolean validateDocument,
SchemaList envelopeSpecNames, SchemaList documentSpecNames, IFFDocumentSpec docSpecType,
SuspendCurrentMessageFunction documentScanner)
at Microsoft.BizTalk.Component.XmlDasmReader.CreateReader(IPipelineContext pipelineContext,
IBaseMessageContext messageContext, MarkableForwardOnlyEventingReadStream data, Encoding
encoding, Boolean saveEnvelopes, Boolean allowUnrecognizedMessage, Boolean validateDocument,
SchemaList envelopeSpecNames, SchemaList documentSpecNames)
at Microsoft.Solutions.BTAHL7.Pipelines.HL72fDasm.ParseMessageBody(IPipelineContext
pc, ArrayList& xmlErrors, Boolean& fatalError)
at Microsoft.Solutions.BTAHL7.Pipelines.HL72fDasm.ProcessIndividualMessage(IPipelineContext
pc)
at Microsoft.Solutions.BTAHL7.Pipelines.HL72fDasm.ProcessChunkedMessages(IPipelineContext
pc)
at Microsoft.Solutions.BTAHL7.Pipelines.HL72fDasm.GetNext(IPipelineContext pc)

Microsoft.BizTalk.Component.XPathHelper.CheckXPathExpression(String
strXPath)
is
the main culprit.

From
my reverse engineering efforts I tracked the problem down to the result of this method
call:

namespace Microsoft.BizTalk.Component

{

    internal sealed class XPathHelper

    {

        private XPathHelper()

        {

        }


 

        public static void CheckXPathExpression(string strXPath)

        {

            if (XPathCanonizer.Canonize(strXPath, true)
==
null)

            {

                string empty = string.Empty;

                string[]
strArrays
= new string[]
{ strXPath };

                throw new ComponentException((uint)-1061153675,
empty, strArrays);

            }

        }

    }

}


 

//Here’s
essentially the code the above line calls –


 

public class CanonicalXPath

            {

                private XPathExpression
_xpath;


 

                private bool _ignoreNS;


 

                public XPathExpression
XPathExpression

                {

                    get

                    {

                        return this._xpath;

                    }

                }


 

                internal CanonicalXPath(string xpath, bool ignoreNS)

                {

                    this._ignoreNS = ignoreNS;

                    XPathExpression
xPathExpression
= new XPathExpression(xpath);

                    StringBuilder
stringBuilder
= new StringBuilder();

                    IQuery[]
expression
= xPathExpression.GetExpression();

                    for (int i = 0;
i < (
int)expression.Length;
i++)

                    {

                        IQuery
query
= expression[i];

                        if (query is NullQuery)

                        {

                            break;

                        }

                        stringBuilder.Append(“/”);

                        XPathCanonizer.XPathCanonizerState.CanonicalXPath.StepCanonizer
stepCanonizer
= new XPathCanonizer.XPathCanonizerState.CanonicalXPath.StepCanonizer(this,
query);

                        stringBuilder.Append(stepCanonizer.Process());

                    }

                    this._xpath = new XPathExpression(stringBuilder.ToString());

                }


 

                private class StepCanonizer

                {

                    private readonly XPathCanonizer.XPathCanonizerState.CanonicalXPath
_owner;


 

                    private readonly StringBuilder
_sb;


 

                    private readonly IQuery
_toplevelQuery;


 

                    private string _name;


 

                    private string _namespace;


 

                    private bool _isAttribute;


 

                    public StepCanonizer(XPathCanonizer.XPathCanonizerState.CanonicalXPath
owner, IQuery stepQuery)

                    {

                        this._owner = owner;

                        this._sb = new StringBuilder();

                        this._toplevelQuery = stepQuery;

                    }


 

                    private void _generate()

                    {

                        if (this._isAttribute)

                        {

                            this._sb.Append(“@”);

                        }

                        this._sb.AppendFormat(“*[local-name()='{0}'”, this._name);

                        if (this._namespace
!
= null)

                        {

                            this._sb.AppendFormat(
and namespace-uri()='{0}'”
, this._namespace);

                        }

                        this._sb.AppendFormat(“]”, this._name);

                    }


 

                    private void _processAxis(BaseAxisQuery
axisQuery)

                    {

                        if (!string.IsNullOrEmpty(axisQuery.Prefix))

                        {

                            throw new XPathCanonizer.XPathCanonizerState.XPathCanonizationException();

                        }

                        switch (axisQuery.NodeType)

                        {

                            case XPathNodeType.Element:

                            {

                                this._isAttribute = false;

                                break;

                            }

                            case XPathNodeType.Attribute:

                            {

                                this._isAttribute = true;

                                break;

                            }

                            default:

                            {

                                throw new XPathCanonizer.XPathCanonizerState.XPathCanonizationException();

                            }

                        }

                        string name = axisQuery.Name;

                        if (!string.IsNullOrEmpty(name))

                        {

                            this._name = name;

                            this._namespace = string.Empty;

                        }

                    }


 

                    private void _processFilter(FilterQuery
fq)

                    {

                        this._processAxis(fq.Axis);

                        this._processPredicate(fq.Predicate);

                    }


 

                    private void _processPredicate(IQuery
q)

                    {

                        Type
type
= q.GetType();

                        if (type
==
typeof(AndExpr))

                        {

                            AndExpr
andExpr
= q as AndExpr;

                            this._processPredicate(andExpr.LeftOperand);

                            this._processPredicate(andExpr.RightOperand);

                            return;

                        }

                        if (type
==
typeof(BooleanFunctions))

                        {

                            this._processPredicate((q as BooleanFunctions).BaseQuery);

                            return;

                        }

                        if (type
!
= typeof(LogicalExpr))

                        {

                            throw new XPathCanonizer.XPathCanonizerState.XPathCanonizationException();

                        }

                        LogicalExpr
logicalExpr
= q as LogicalExpr;

                        if (logicalExpr.OperatorName
!
= “EQ”)

                        {

                            throw new XPathCanonizer.XPathCanonizerState.XPathCanonizationException();

                        }

                        IQuery
leftOperand
= logicalExpr.LeftOperand;

                        IQuery
rightOperand
= logicalExpr.RightOperand;

                        if (leftOperand is OperandQuery)

                        {

                            IQuery
query
= leftOperand;

                            leftOperand = rightOperand;

                            rightOperand = query;

                        }

                        if (!(leftOperand is MethodOperand)
|| !(rightOperand
is OperandQuery))

                        {

                            throw new XPathCanonizer.XPathCanonizerState.XPathCanonizationException();

                        }

                        MethodOperand
methodOperand
= leftOperand as MethodOperand;

                        object str = (rightOperand as OperandQuery).GetValue(null).ToString();

                        string functionName = methodOperand.FunctionName;

                        string str1 = functionName;

                        if (functionName
!
= null)

                        {

                            if (str1
==
“FuncNameSpaceUri”)

                            {

                                string str2 = (string)str;

                                if (this._namespace
!
= null && this._namespace
!
= str2)

                                {

                                    throw new XPathCanonizer.XPathCanonizerState.XPathCanonizationException();

                                }

                                this._namespace = str2;

                                return;

                            }

                            if (str1
==
“FuncLocalName”)

                            {

                                string str3 = (string)str;

                                if (str3
==
null ||
str3.Length == 0)

                                {

                                    throw new XPathCanonizer.XPathCanonizerState.XPathCanonizationException();

                                }

                                if (this._name
!
= null && this._name
!
= str3)

                                {

                                    throw new XPathCanonizer.XPathCanonizerState.XPathCanonizationException();

                                }

                                this._name = str3;

                                return;

                            }

                        }

                        throw new XPathCanonizer.XPathCanonizerState.XPathCanonizationException();

                    }


 

                    private void _validate()

                    {

                        if (this._name
==
null || this._name.Length
== 0)

                        {

                            throw new XPathCanonizer.XPathCanonizerState.XPathCanonizationException();

                        }

                        if (this._namespace
==
null &&
!
this._owner._ignoreNS)

                        {

                            throw new XPathCanonizer.XPathCanonizerState.XPathCanonizationException();

                        }

                    }


 

                    public string Process()

                    {

                        Type
type
= this._toplevelQuery.GetType();

                        if (type
==
typeof(FilterQuery))

                        {

                            this._processFilter(this._toplevelQuery as FilterQuery);

                        }

                        else if (type
!
= typeof(ChildrenQuery))

                        {

                            if (type
!
= typeof(AttributeQuery))

                            {

                                throw new XPathCanonizer.XPathCanonizerState.XPathCanonizationException();

                            }

                            this._processAxis(this._toplevelQuery as BaseAxisQuery);

                        }

                        else

                        {

                            this._processAxis(this._toplevelQuery as BaseAxisQuery);

                        }

                        this._validate();

                        this._generate();

                        return this._sb.ToString();

                    }

                }

            }


 

Write
a small test app:

1)
Open VS.NET and create a console app

2)
Reference – c:\program files\microsoft biztalk server XXXX\pipeline components\Microsoft.XLangs.RuntimeTypes.dll
2.1) Reference from the GAC – C:\Windows\assembly\GAC_MSIL\Microsoft.BizTalk.XPathReader\<your
version>\Microsoft.BizTalk.XPathReader.dll

Here’s
my sample code – I’m still working through making my XPath compliant:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using Microsoft.XLANGs.RuntimeTypes;

using Microsoft.BizTalk.XPath;


 

namespace XpathExpressionTester

{

    class Program

    {

        static void Main(string[]
args)

        {

            var
strFailed
= “/*/*[local-name()=’PRD_ProviderData’]/*[local-name()=’PRD_1_ProviderRole’]/*[local-name()=’CE_0286_0_Identifier’][text()=’RT’]/../../*[local-name()=’PRD_7_ProviderIdentifiers’]”;

            var
strGood
= “/*[local-name()=’Fred’]/*[local-name()=’PRD_ProviderData’]/*[local-name()=’PRD_1_ProviderRole’]/*[local-name()=’CE_0286_0_Identifier’][2]”;//[text()=’RT’]”;
// /../../*[local-name()=’PRD_7_ProviderIdentifiers’]”;

            //var
strGood = “/*[local-name()=’Fred’]/*[local-name()=’PRD_ProviderData’]/*[local-name()=’PRD_1_ProviderRole’]/*[local-name()=’CE_0286_0_Identifier’
and text()=’RT’]/../../*[local-name()=’PRD_7_ProviderIdentifiers’]”;

            var
xp
= new XPathExpression(strGood);

            Console.WriteLine(“We
got {0}”
,
xp.GetExpression().Count());

            RunTest(strFailed);

            RunTest(strGood);

            Console.ReadLine();

        }


 

        private static void RunTest(string str)

        {

            XPathExpression
result
= XPathCanonizer.Canonize(str, true);

            if (result
!
= null)

                Console.WriteLine(“We
got {0}”
,
result.XPath);

            else

                Console.WriteLine(“BoomBoom
– we failed”
);

        }

    }

}


 

 

Blog Post by: Mick Badran