Reading text value from node using XPath function directly in BizTalk orchestrations

The XPath function that’s available directly inside BizTalk orchestration is a powerful little tool. However I’ve seen a couple of project where developers just grown tired of it and started creating their own little libraries instead. I’ll be the first to admit that the XPath function isn’t perfect, and it sure doesn’t work like most of the other XPath engines (which is the biggest problem) but it’s still inside the orchestration and you can use it to both read and assign values to a message which is super useful! Basically I don’t see a valid reason for bringing more complexity into your solution by adding another library – as long as you’re just going to read or set value using XPath.

However there is one trick that you should know of when it comes to reading a text value from a node. Basically you have to use both the string() and
text() XPath functions. Both Charles Young and Yossi Dahan has good post on this subject. Also if your new to writing XPath expressions for complex schemas with loads of namespaces and stuff (like schemas in BizTalk) this post could be useful for you.

Finally a nice tool for writing and testing small XPath expression inside Visual Studio (if you don’t want to spend x minutes waiting for XmlSpy to start up …) is XPathmania. Read about it here – I use it all the time!

Reading text value from node using XPath function directly in BizTalk orchestrations

The XPath function that’s available directly inside BizTalk orchestration is a powerful little tool. However I’ve seen a couple of project where developers just grown tired of it and started creating their own little libraries instead. I’ll be the first to admit that the XPath function isn’t perfect, and it sure doesn’t work like most of the other XPath engines […]

PipelineTesting: Creating Pipelines

PipelineTesting: Creating Pipelines

Here are some options I’m exploring for creating pipelines for testing.

1. Using default pipelines

To use standard pipelines right now you need to reference Microsoft.BizTalk.DefaultPipelines
and do something like this:

using Microsoft.BizTalk.DefaultPipelines; //
... ReceivePipelineWrapper receivePipeline = PipelineFactory.CreateReceivePipeline(typeof(XMLReceive));

Not hard, but a bit inconvenient. Instead, I’m thinking of:

ReceivePipelineWrapper pipeline = Pipelines.Xml.NewReceive();

2. Creating a pipeline from scratch

To create a pipeline from scratch in the current code you need create an empty pipeline
and add each component at the proper stage. Unfortunately, the API here is pretty
generic, and thus very verbose. Here’s what I’m thinking of:

SendPipelineWrapper pipeline = Pipelines.NewSend()
   .AddAssembler(new XmlAsmComp())
.AddEncder(new MIME_SMIME_Encoder()) .End();

I’m also thinking about doing something to make it easier to use built-in assembler/disassembler
components with specific schemas, as this is pretty hard to do with the current version
without using a pre-compiled pipeline (because of how the properties in the components
are defined).

A Better Interface for PipelineTesting

A Better Interface for PipelineTesting

Last year I wrote the initial version of my PipelineTesting library,
a wrapper library that makes it possible to automate testing of BizTalk
Server 2006 pipelines and pipeline components. Since then, I’ve used the library successfully
on several projects and I’m extremely happy I spent the time creating it, as it has
made my life a lot easier when working with Pipelines.

However, the original API for the library was not the best. While not hard to use,
it was not completely intuitive and it was very verbose, for no good reason except
that it resembled (partially) the original API in the PipelineObjects library from
Microsoft.

Finally this bothered enough that I decided to do something about it and improve the
API with something better. My goals are:

  • Keep the original API compatible. In other words, you should still be able
    to use the original API if you so want (if only to keep compatibility for existing
    users).
  • Make it less verbose, but more readable.
  • Fix pain points in the current API.

The current API works, but it is somewhat painful in the following aspects:

  • Creating pipelines from scratch and using default pipelines
  • Executing Send pipelines (since you need to create collections even if you’re only
    going to use one input message)
  • Manipulating messages

I’ll be exploring some options to fix these issues in following posts, and I’d sure
appreciate any feedback!

More Detail on BizTalk Services and Hosting WF Workflows in BizTalk

Seems like there’s no shortage of new and exciting topics to stay up to date on!


 John Udel has just posted a conversation with John Schewchuck exploring how BizTalk Services plays an integral role in the evolution towards an Internet Service Bus. And, Paul Andrew, product manager for Windows Workflow Foundation, has posted on a new project that demonstrates how to host WF workflows in BizTalk Server! This give you the best of both worlds, WF’s cutting edge programming model coupled with BizTalk’s enterprise scale hosting capabilities.


-Kris

Hanselman joins Microsoft

I

opened my newsreader last night and there on the top of my “Must Read” folder was

a post from Hanselman entitled

“Blue Badge”. Apparently Scott has decided to take the jump and join Microsoft

in ScottGu’s division. According to him, this is what he’ll be doing:

The HR title is a nice generic one like “Program Manager” (I was thinking to get this

on my business card – Scott Hanselman – progman.exe,

what do you think? 😉 ) but in essence I’m going to talk about .NET and Visual Studio

– the whole of DevDiv, including ASP.NET, WinForms, WPF, Silverlight, CLR, LINQ, IIS,

DLR, .NET CF, everything. This means videos, screencasts, podcasts, maybe some Channel

9 stuff, doing articles, wikis, speaking at conferences and large events (invite me!),

creating starter kits, samples, as well as my regular hobby of plugging things into

other things. I’ll also be working on understanding our community (that means

you, Dear Reader)thr ough conversations, visits, and trying to bring

some big picture analysis (the kind of stuff I do now, again) to the .NET 3.5 and

.NET Futures stack. I am also obsessed with getting my new Apple Newton Messagepad

2000 to sync with Outlook 2007, so watch for that.

Personally I’m absolutely thrilled to hear this, because Scott is so very good at

communicating things about the .NET Framework and things developer. I also find

it funny that he created the image above because he knew that the Borg joke would

be made. He’s right of course, people will say he’s going to become faceless,

nameless, and simply join the “Evil Empire” but in reality shouldn’t we be thrilled

that Microsoft wants to hire someone who is so community focused as Scott?

I often give the Linux community crap about hating Microsoft and a reflex, no basis

just a reflexive “Microsoft == Evil” embedded in their psyche. Yet most (certainly

not all) of Scott’s readership are Microsoft .NET developers, because that and gadgets

are what he talks about most often, and yet I expect that many of his own readers

will relate this to the Borg as he did. Why is this?