Things hard and not so hard.... RSS 2.0
# Tuesday, June 24, 2014

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");

        }

    }

}

 

 

Tuesday, June 24, 2014 3:51:23 PM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0] -
BizTalk | General
# Thursday, May 01, 2014

When we create certain sized VMs, the NICs associated with them are throttled for Outbound traffic. Here’s some numbers that were originally published from a little while ago (may have changed since, but these give you a guide):

Specifications

Extra Small

Small

Medium

Large

Extra Large

CPU

1.0 GHz

1.6 GHz

2 X 1.6 GHz

4 X 1.6 GHz

8 X 1.6 GHz

Memory

768 MB

1.75 GB

3.5 GB

7 GB

14 GB

VM Local Storage

20 GB

225 GB

490 GB

1,000 GB

2,040 GB

Network I/O Performance

Low

Moderate

High

High

High

Allocated Bandwidth

5 Mbps

100 Mbps

200 Mbps

400 Mbps

800 Mbps

Thursday, May 01, 2014 11:27:45 AM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0] -
Azure | Integration | Dev | General
# Friday, April 04, 2014

image

 

Looks pretty snazzy :)

Friday, April 04, 2014 12:02:25 PM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0] -
.NET Developer | Azure | Dev | General
# Tuesday, March 25, 2014

image

Great day was had by all and after some issues with ‘guest wifi’ at the start of my presentation we were off. Top questions and a good vibe filled the room.

As promised – here’s my slides I used and see you this Saturday at the Global Windows Azure Bootcamp – Sydney (Worldwide event)

DEMOS - here

Have a great day folks and see you soon.

Tuesday, March 25, 2014 11:13:43 AM (AUS Eastern Daylight Time, UTC+11:00)  #    Comments [0] -
Azure | Integration | BizTalk | Events | Recordings | General
# Thursday, February 27, 2014

Folks we’re finally here! The stage is set and light the lights as it’s all ready to go oooorrrrffff on March 29th 2014!

What is it – it’s back!!!!

 Global Windows Azure Bootcamp

The Global Windows Azure Bootcamp – over 134 locations will be delivering this world wide event at the same time (same relative time).

In April of 2013 we held the first Global Windows Azure Bootcamp at more than 90 locations around the globe! This year we want to again offer up a one day deep dive class to help thousands of people get up to speed on developing Cloud Computing Applications for Windows Azure. In addition to this great learning opportunity the hands on labs will feature pooling a huge global compute farm to perform diabetes research!

Where is it?

It’s back at Saxons in the city – 10 Barrack Street, NSW 2000 (see the rego page for all the details)

Why you?

It’s a free day of Azure training delivered by several MVPs and other community prominent experts.

Agenda for the day

We will be doing a combination of presentations and hands-on-labs around Azure and all the new features it has to offer.

The final agenda is yet to be determined but it’s something like:

  What the Days Play looks like…
8:30 – 9:00am  Arrive and get comfy, make sure everything is working.
9:00 – 9:15am  Intros, Outline what will be covered for the day & take your input as to what areas to drill into.
9:15 – 9:45am  What is Azure and what has it done for me lately?
9:45 – 10:15am  HOL #1
10:15 – 10:45am  Designing Hybrid Solutions to coexist with On-premise solutions.
10:45 – 11:15am  HOL #2
11:15 – 12:15pm  Exploring Azure and some snazzy items in the toolkit.
12:15pm – 1pm   L U N C H
13:00 – 13:30 Data strategies within Azure.
13.30 – 14:00 HOL #3
14:00 – 14:30 Azure Mobile Services
14:30 – 15:00 HOL #4
15:00 – 15:30 Setting up Azure Active Directory Federation
15:30 – 16:00 HOL #5
16:00 - …. Q&A & general tyre kicking.
   

 

*** What’s required from you on the day ***

BYOD – bring your own machine and internet access will be provided on the day.

Make sure you have a ‘Microsoft Account’ (aka live account) and have signed up for a free trial to Azure Services (I may have some codes for you, but dont count on it)

For the HOL material, we’ll take it from the Windows Azure Training Kit as a basis.

 

Get your skates on and get on over to a great day!

Register Here

Thursday, February 27, 2014 7:26:56 PM (AUS Eastern Daylight Time, UTC+11:00)  #    Comments [0] -
Azure | GWAB | Breeze | Events | General | Impack
# Friday, January 31, 2014

The buzz on the street is Satya Nadella to be the next CEO at Microsoft.

http://www.pcworld.com/article/2092196/report-satya-nadella-to-be-named-microsoft-ceo-gates-out-too.html

Having met and spent time with him – he comes across as being very thoughtful with points in question being responded to carefully and measured.

Great innovator & I think will guide the ship where it needs to go to be successful during these technologically shifting times.

Wishing you all the success Satya.

Friday, January 31, 2014 11:48:50 AM (AUS Eastern Daylight Time, UTC+11:00)  #    Comments [0] -
General | MVP
# Wednesday, January 15, 2014

My take and some answers on ithttp://www.cloudsecurityalliance.org/topthreats/

Welcome back folks to a beautiful 2014 and I had an interesting one while going through a Cloud Solution Design
I came across this document The Notorious Nine Cloud Computing Top Threats in 2013 and I thought I’d talk through these concerns one by one.

  1. Data Breaches -  this issue can occur on many levels and I don’t think it’s just limited to ‘Cloud’ per se – it could be your insurance company down the road,
    the doctor, dentist etc. and we’ve all seen those TV shows where the ‘hustlers’ go through someone’s trash to pull out key gems of information to unlock the scam.

    Interestingly in the paper, the university of North Carolina Chapel Hill came up with a technique to steal data from a VM running as one of many within the same host, with the ‘unis VM’ able
    to steal data being transmitted through the other VMs. This was performed through a combination of monitoring various known factors of the host,
    such as thread scheduling, L1 cache and power. The paper highlighted that currently the virtualisation technologies need to do more about isolation.
  2. Data Loss – Cloud and non-cloud users fall foul of this with Cloud typically being a target for hackers. Geo-Replication, backups and Government policies on data and it’s storage all help here.
    Encryption could be something that you may want to employ to ensure some protection over the copies of data now present.
  3. Account Hijacking – gaining unlawful access to account details such as user/pass combination. Amazon in 2010 was foul to a cross site scripting bug that allowed 3rd parties to get access
    to user/pass credentials. With the explosion on the Cloud keeping your credentials safe becomes that much more important. Also changing passwords frequently would be a good habit
    to get into.

    The other interesting point here to note is that if your account is indeed hijacked then it maybe sometime until the hackers exploit this.

    Gaining access to someone’s account doesn’t have to be a hi-tech solution either. As in the movie Sneakers all that was required was a dinner conversation for the voice password
    ”My voice is my passport”
  4. Insecure APIs – Cloud based APIs form the under pinning of many software and services available today. Essentially ensure these APIs are secure to the best possible effort and
    while they may not be compromised, are they able to stand DDOS attacks for e.g.
  5. Denial of Service – With the advent of the Cloud and cloud services, these attacks could for e.g. hit your Cloud based website causing it to be unresponsive, but you’re still being
    billed for the usage. Also within Microsoft Azure web site configurations we can now add DDOS settings to indicate when the underlying load balancer should throttle the requests coming
    from a particular rogue client.
  6. Malicious Insiders – the focus here is both internal, hosted and Cloud based solutions. Policies and procedures are more important within the Cloud space – what procedures does your
    provider follow? Who can access the encryption keys? where are they stored? etc.
  7. Abuse of Cloud Services – The Cloud possesses many servers, elastic scale and dynamic compute power, making it the perfect platform
    for a bot-net to spin up in and get to work. Azure limits default subscriptions to 20 cores, more are available upon request.
  8. Insufficient Due Diligence – Don’t jump into the Cloud platform without examining the offer. Many hosting providers have added the word ‘Cloud’ to the front of their names as in ‘Cloud Hosting Providers’ with the underlying process and infrastructure the same, with the same vulnerabilities.

    In this space Azure has many ratified processes that get re-certified each year with some of these processes available to military grade specification.

    Cloud is big business for Microsoft and getting things like this wrong would be a true achilles heel.
  9. Shared Technology Issues – as Cloud providers share underlying technologies from CPUs, Services, Storage and other services. If these are exposed then so is your platform potentially.

Talk to you soon.

Mick.

Wednesday, January 15, 2014 4:07:07 PM (AUS Eastern Daylight Time, UTC+11:00)  #    Comments [0] -
Azure | Integration | General | Other | TechTalk
# Monday, November 25, 2013

Just home from a great week that was in relation to Microsoft’s Integration strategy for both on-prem and cloud solutions.

The first part of the week was the MVP Summit and it’s always great to catch up with the fellow crew and solve the world’s problems over a beer or two. Very positive things came from that….a headache :)

By the time the summit was on, there were brain’s buzzing with activity.

The Summit

The first day of the 2 day summit was spent by the Product groups presenting on what’s new, the roadmap, the vision and how the new world hangs together.

A major component to come out of this was BizTalk Services.

An Azure service that guarantees a certain performance level as well as being able to design tranformations, EDI, EAI all at the end of a RESTful endpoint.

image 

Development, Compiling and Deployment is all done out of a new Visual Studio 2012 Project Template.

The Azure BizTalk Services environment is guaranteed in ‘BizTalk Units’ – the BizTalk team have done well to build a flexible feature on the Azure Fabric.

Currently there’s a range of Receive/Endpoints and ‘Destinations’ (Send Ports) that the platform supports – watch this space as more will be added no doubt.

image

Later in the summit we also learnt that the XBOX One Team uses BizTalk Services to process orders (& others) across the world.

BizTalk Services Performance for the XBOX One team.

WP_20131122_018 (1)

 

Some great numbers going through BizTalk Server for a US Healthcare provider.

 BizTalk Services Throughput 


With the Impack alliance hard at work as always showing our capabilities thanks to Matricis, Breeze and Codit

image

 

The favourite US pastime that I was fortunate enough to go to thanks to Kent Weare whom organised a troop of us.

6tag_171113-172110

Monday, November 25, 2013 8:10:07 PM (AUS Eastern Daylight Time, UTC+11:00)  #    Comments [0] -
Alliance | Azure | BizTalk Services | BizTalk | BizTalk 2013 | BizTalk Services | MVPSummit13
# Wednesday, October 02, 2013

I received an email in the early hours of this morning right when Arsenal just slotted one home in the Champions League…and I thought…”Can this moment get any better?” – YOU BET! My MVP re-award email came through :)

Big thanks to the folks at Microsoft for bestowing this award to me again (9th year running) and being given the chance to be part of a great knowledgeable MVP community.

The real thanks goes to you guys in the community of which I try to make a difference in the Azure Space. With cloud offerings changing every other week (it feels like), it’s almost a full time job keeping on top of things. New numbers, bigger limits, faster storage, different ways to manage traffic, connections, deployments, code platforms… and the list goes on.

Thanks to each and all of you for making this award possible in this great country – Australia (down under, Oz… and any other name you know it as)

Boom!!

or as a friend says ‘Ka-Boom!’

Wednesday, October 02, 2013 2:45:44 PM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0] -
Azure | Integration | BizTalk | Dev | General | MVP
# Tuesday, October 01, 2013

While search for some MS Events – I gravitated towards

https://msevents.microsoft.com and boom! I recognise her and her and me!

image 

image

 

image 

(there’s my hand in there)

Tuesday, October 01, 2013 3:06:02 PM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0] -
Events | General
Archive
<August 2014>
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456
Blogroll
 AppFabric CAT
AppFabric Windows Server Customer Advisory Team - New Blog.
[Feed] BizTalk 2006 - Windows SharePoint Services adapter
BizTalk 2006 Sharepoint adapter!!
 Breeze SharePoint 2010 Bootcamp
Breeze SharePoint 2010 Bootcamp
[Feed] BTS 2006 R2/EDI
[Feed] Chris Vidotto (MS BTS Legend)
Needs no intro....
 Mark Daunt
BTS/SPS/.NET GURU!!!
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2014
Breeze
Sign In
Statistics
Total Posts: 603
This Year: 7
This Month: 0
This Week: 0
Comments: 270
All Content © 2014, Breeze