Got more questions? Find advice on: ASP | SQL | Regular Expressions | Windows
in Search
Welcome to XmlAdvice Sign in | Join | Help

Christoph .NET

My angle on brackets

BizTalk Baby Steps

After focussing my orchestration efforts on the tools by the folks at OpenStorm, I started exploring the orchestration capabilities of BizTalk Server 2004. The standards focused approach of the OpenStorm tools is very appealing, but BizTalk's rich feature set and the integration of .NET into orchestrations allow to build very powerful orchestrations without having to develop services for everything that's not covered by the BPEL standard.

The lack of BizTalk developer documentation however, is making it very hard to take your first baby steps with BizTalk. You feel like a toddler with the urge to run, but you first have to master taking simple steps first. I had quite a few moments where I just wanted to plop on my butt an cry until my mommy comes and makes it all go away ...

I hope this article will help some people to get past the baby step phase quicker and get them running in no time.

Installation

The BizTalk installer does not take care of installing all the prerequisites. Here are two issues I ran into. Although both issues are documented in the Microsoft Knowledgebase, the installation does not install these items if they are not already present on your computer.

  • The BizTalk installer does not take care of installing all the prerequisites. For example, the Health and Activity Tracking (HAT) tool requires of the Office XP version of the Web Controls. If you don’t have the OWC10.dll installed and registered you will get the following error when you run the HAT: 'Activeview.columnaxis' is null or not an object.

    This problem and the solution are documented at: http://support.microsoft.com/?kbid=836119
  • Deploying an orchestration results in an InvalidCastException without installing a COM+ hotfix.

Types

  • An orchestration knows variables of 2 types: Messages and Variables. Messages correspond to XML Schema types and Variables correspond to .NET Types. You can access data in messages via properties you define with the schema editor or the xpath() function.
  • Orchestration Variables must be of Xml serializable types, if their scope is beyond a scope with atomic transaction behavior. The types need to be serializable so BizTalk can persist an orchestration instance to XML when it needs to dehydrate it. This makes sense because the XmlSerializer is the about the fastest way to map between object instances and XML documents, but you need to keep in mind the limitations that the XmlSerializer imposes when you add variables to your orchestration. Unfortunately, one class that does not conform to these limitations is the XmlNodeList. Therefore you can't store a message fragment you selected you got by calling XmlDocument.SelectNodes in an orchestration variable.

Working with Message Types

  • The first realization one needs to have is that any Message in an orchestration can be assigned to a Variable of the .NET type System.Xml.XmlDocument. 
  • You can assign XML data from one message to another with the data mapper or the expression editor. While the data mapper is much easier to work with, it prevents BizTalk to export the orchestration to BPEL even if your maps don't use any custom functiods (bummer!). Btw: the OpenStorm orchestrator on the other hand can export graphical data maps to BPEL ...

The Expression Editor

  • The Expression editor marries the two type systems (.NET and XML Schema) available to an orchestration. You can write C#-like code against .NET classes, assign parts from one message to another and execute XPath expressions against messages.
  • Of course, expressions calling .NET objects do not export to BPEL ...
  • You can call System.Diagnostics.*.WriteLine to generate trace and debug messages to follow the execution of an orchestration in DebugView. For simple debugging tasks trace messages can be more efficient than the orchestration debugger. If you need to write out trace messages containing the XML content of a message you can assign a message instance to a variable of type System.Xml.XmlDocument and then write the OuterXml property to the trace output.

The Data Mapper

  • The Mass Copy functoid copies an element and all its children between compatible elements in the source and the destination message.
  • The String Concatenation functoid can output constant strings as well. It does not need any input from the source document(s).
  • The Looping functoid outputs sequences of the same XML element, i.e. elements where maxOccurs > 1.
  • The context menu for a data map file in the Solution Explorer allows to test a map and validate the output against the output schema.

The Schema Editor

  • The context menu for an XML Schema file in the Solution Explorer provides options to generate an instance document for the schema. BizTalk stores the generated instance document in the user's temp directory. Use this document as a test input for your orchestrations.
  • You can only promote unique leaf nodes to properties. Use the xpath() function if you need to access elements that have XML content or maxOccurs > 1

Decision Expressions

  • Decision Expressions have to be simple boolean expressions. You need to perform multi-step computations in expression shapes, not in a Rule shape that belongs to an expression.
  • Some type conversions do not happen automatically. You need to explicitly convert types with the .NET Convert class when you see messages telling you

    operator XX can not be applied to operands of type 'System.Object' and 'System.Int32'.

    If you are trying to branch based on the presence on an element with a XPath query for example, the expression in the Rule shape would be:

    System.Convert.ToInt32(xpath( Message_1, "count( //*[local-name()='parent' and namespace-uri()='urn:webservices.com']/*[local-name()='child' and namespace-uri()='urn:webservices.com'])" ) ) > 0

Orchestrations

  • Calling the same request-response web service port from parallel execution branches requires surrounding the corresponding send and receive shapes with a scope to synchronize send and receive if there no correlations are set up for the recieve message.
  • An orchestration owns the ports and types it defines.
  • You cannot export an orchestration to BPEL if it references ports and types defined in an orchestration that is not exportable.
  • You get errors and warning that refer to line numbers when you build a BizTalk project. Now, you don't really see any line numbers in the orchestration designer, do you? The line numbers refer to the XLANG/s code in the actual .odx file. If you bring it up as a text file (right click on the file in the Solution Explorer -> Opn With ... and select the HTML/XML Editor) then you can see the lines causing the error.

Debugging

  • BizTalk writes debug information to the Windows Event Log. Look there for more information if things don't work the way you expect them to work.
  • When a web service returns a fault to an orchestration, the SOAP adapter will repeat the web service call according to the retry settings configured for the Send Location. The details about the fault are written to the Event Log.
  • The Orchestration Debugger is accessible from the Health and Activity Monitoring tool, not the Visual Studio IDE.

Hope this helps. Microsoft announces to update the BizTalk documentation quarterly(!). The first update on 4/1/2004 improved the situation somewhat, but there are still lots of wholes in the docs.

Let me know if you feel I should add more items.

Published Tuesday, March 30, 2004 11:27 PM by christoph

Comments

 

christoph said:

The BizTalk Orchestration Debugger appears to be missing from the HAT tool in the release version. The only option is to use strategies like the one you describe earlier in the article (Debug.WriteLine combined with DebugView).
April 2, 2004 10:24 AM
 

christoph said:

>The Orchestration Debugger is accessible from the Health and Activity Monitoring tool, not the Visual Studio IDE.

Could you give more detail on this?
April 2, 2004 10:26 AM
 

christoph said:

The Orchestration Debugger is part of the release version. You need to query in the HAT when there is an orchestration instance you can attach to.

When you have the HAT open go to Operations from the top menu bar and select "Service Instances".

In the Service Instance View, click on the Run Query button. A grid view of the available instances should appear (see the screenshot at: http://xmladvice.com/blogs//images/blogs_xmladvice_com/christophdotnet/116/o_DebuggerMenu.GIF)

Right click on the instance that you want to debug and click on the Orchestration Debugger item.

HTH,
Christoph
April 2, 2004 10:48 AM
 

christoph said:

We are trying lab 12 of HWS and fail on the deployactions.cmd with the following error any thoughts?

Error: Failed updating binding information.
BindingException: Receive Location 'ActionInterruptReceiveLocation' has no receive handler. Specify a Receive Handler.


We kicked our consulting firm out, because they couldn't even install biztalk

sean.shilling@badgerlandfcs.com
July 19, 2004 5:43 PM
 

christoph said:

Hi all:

I am new to working with Biztalk 2004. The project I am working on: Simple. take an xml data (as Response from EDI vendor), and update SQL 2000 server data using Updategram.

I have been able to create the xml schema for the response, and desired upgradegram format using the biztalk editor. However, I am unable to move forward hereon. Can somebody help???

Thanks in advance.
Ashish.
September 27, 2004 4:53 PM
 

christoph said:

Ashish,

can you email me via the blog?

Christoph
September 28, 2004 11:49 PM
 

christoph said:

Hi All,

I have one correlation type which is used in one correlation set and has been configured for two receive ports. Port 1(correlation initialized), port 2(Following correlation set)

Problem explanation
--------------------------
eg : field in the correlation type is "username" and "year"

suppose port1 it has received "Jonde" and "2004" for the correlation type, I want in the second receive port to Check with the same field name but the value should be "Jonde" 2003" , ie I have to change the value in the year for the port 2. Is there any way

*both the receive port is having the same schema
*I am using Share adapter for getting the infopath forms from sharepoint

thanks in advance

Suresh.A
December 20, 2004 8:57 AM
 

christoph said:

Hi guys

I am a BizTalk n00b, so apols in advance for the silly questions... I'll split them into two separate messages...

I have just started playing with the app (and like it) with a view to verifying that I can get it to relatively easily do the sort of things I have had to do in bespoke C# apps.

---

I have a System.Decimal variable declared in an orchestration. Can I use its value as a parameter in a Multiplcation function in a mapper used by that orchestration?

I tried just typing the name in a parameter field, then the ns.name, but no luck.

Any help appreciated!

Best regards

Bob
February 15, 2005 10:24 AM
 

christoph said:

March 5, 2005 4:04 AM
 

christoph said:

I have a client in the healthcare field looking for someone to Provide subject matter expertise on BizTalk Server 2004 within a Production Integration environment. Location will be southern NH - USA. Could be contract to fulltime. Requires 5 to 7 years software engineering experience and
3+ years of BizTalk experience including administration and development. This is a forward-looking position involving the latest Service Oriented technologies and architectures. More details available for qualified candidates.

bob@franklinkey.com
April 29, 2005 11:40 AM
 

christoph said:

I am a newbie. I have a simple postional flat file (with only two fileds in it) which is disassembled in the Receive Pipleine. How can I insert the data in these fields into a table located in SQL Sever database. I want to call an existing (already created) store procedure from the orchestration stage which could insert the data into the target database table. How can I accomplish it. I apologise if this is a silly question?
July 4, 2005 4:05 AM
 

TrackBack said:

April 3, 2004 1:00 PM
 

TrackBack said:

April 20, 2004 12:43 AM
 

TrackBack said:

April 29, 2004 9:46 AM
 

TrackBack said:

I've started searching for Biztalk relation blogs recently given that it is now my primary focus at work. I found a few and decided to make use of Addy Santo's excellent Blogwave to create an aggregated version of the weblogs I have found. Effectively this creates something similar to Longhorn Blogs, an aggregated site on a specific topic. So. You can point your aggregator to my "Biztalk Blogs" aggregation which is updated every 30 minutes (so long as I leave my workstation on at the office, which is almost always). I will try and add an xslt stylesheet to this at some point aswell (Addy, feature request, allow linking to an xslt stylesheet?). If anyone knows of any Biztalk Blogs I am missing, drop me a line The List so far: Kevin B Smith's Weblog BizTalk Core Engine's WebLog Charles Young A Biztalk Enthusiast - Jeff Lynch Robert Rijsdijk's BizTalk Server Weblogs Christoph .NET - Biztalk Baby Steps CaPo's Integration adventures Gilles' WebLog Note that unfortunately due to the way that Blogwave operates the "author" of each feed is not persisted and is replaced by the title I have given the collection of aggregations. I have put in a request to Addy for a feature along this line to exist....
August 10, 2004 4:52 AM
 

Ways to get in shape said:

Check out what this blog has to say about living the fit life.

May 31, 2007 8:23 AM
 

healthy recipes to lose weight said:

The studies show that people on a diet almost always put the weight back on. This blog gives you great solution to turn eating into a healthy habit. No dieting required.

June 4, 2007 3:00 PM
 

hgh Supplement said:

HGH was originally made as a treatment to counter-balance those that had a deficiency of the hormone. Anyone considering an anti-aging HGH product should become intimately aware of its effect, and some products use very little of the actual hormone, or

June 6, 2007 2:56 PM
 

Aging Process said:

Once you fully understand this, you\'ll be able to research more surely.

August 31, 2007 9:18 AM
 

Cymbalta with buspar. said:

Side effects of buspar. Buspar side effects weight loss.

November 12, 2008 10:46 PM
Anonymous comments are disabled