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

Introduction to No-SQL

Introduction to No-SQL

hello everyone, I’m starting a new series of blog post around no-sql. Why did I choose the domain ? Because, I think that the future will pass by No-SQL, and that evereybody talks about big data. So before talking about big data, for me,I think it is essential to first talk about No-SQL. What is […]
Blog Post by: Jeremy Ronk

Sentinet – Service Virtualization Part 7 – BizTalk Server

In the previous blog post I demonstrated how I can secure my internal BizTalk services application with requirements for Federated Security based on SAML tokens. The goal was to enable my BizTalk service to be a “claims-aware” application. Just like with all other cases of virtualizing BizTalk services through Sentinet, turning the BizTalk service application into a “claim-aware” application did

ESB Toolkit Tip #9: Use MongoDB for Message Body Tracking in the ESB Toolkit

One of the duties of an ESB is monitoring. In BizTalk you can use Message Tracking to track the message body and message properties. There is only one but, Tracking a lot of data can be bad for the performance so Microsoft recommends that you should only enable the minimum tracking required for your application, as this will reduce the amount of data logged and lower the risk of tracking bottlenecks.

So, it can be useful in a development- or test environment but you can’t use this feature in a production environment! But also in a production environment you want to be able to track message bodies. MongoDB could be a very good alternative to track message bodies because MongoDB is a web scale database, and doesn’t use SQL or JOINs, so it’s high-performance. An other advantage is that it is a document database. You can store the entire BizTalk message as a document in a collection but you can still search on specific items in the document.
I’ve always been a big fan of SQL Server so I was a bit skeptical about MongoDB but seeing is believing. The actual saving of a .XML message to MongoDB only takes 1 or 2 milliseconds!

 

Using a custom Itinerary Messaging Service for Message Body Tracking

The strength of the ESB Toolkit is that it’s highly extensible so you can create your own services to execute Itinerary steps. You can implement a custom Tracking Service to store the messages in MongoDB.

 
At runtime you can use a tool like MongoVUE to find the messages that are stored in MongoDB.
Notice that in the Message also the InterchangeID value is available to match the Message Body with a Tracking Event in BizTalk.
 

You can match the Message Body that is stored in MongoDB with a tracked Message in BizTalk.
1. Open the BizTalk Administrator and Search For: Tracked Message Events
2. Click on an Event and use the Message ID to match the Message in the Event to the Message Body in MongoDB.

 

See Also

For more information on how to use MongoDB for Message Body Tracking see:

  • Using MongoDB for Message Body Tracking in the ESB Toolkit for BizTalk 2013