Your Guide to BizTalk Message Context Properties whitepaper

Your Guide to BizTalk Message Context Properties whitepaper

As you most likely are aware, when a document is received by a BizTalk Server adapter, the adapter creates a BizTalk message for the document. The BizTalk message contains the document that was received as well as a message context. The message context is a container for various properties that are used by BizTalk Server when processing the document. Each property in the Message Context is composed of three things, a name, a namespace, and a value.

Message context properties are added to the message context throughout the lifetime of the message as it passes through the BizTalk Server. These properties:

  • Are either extracted from the message itself, for example, order id or shipment number
  • Or added by pipelines and adapters at the receive location, for example, transport name or receive port name

There are mainly two benefits of this context:

  • The first is to provide the various components of BizTalk, an easy access to these properties, without having to parse the message
  • The second is to support content-based routing.

There are two different types of message context properties used by BizTalk as described below:

  • Distinguished Fields
  • Property Fields.

In this whitepaper, you will learn the key differences between Distinguished and Property Fields but most importantly you will have access to a complete list of known property schema and properties used internally by the BizTalk Server out-of-the-box components.

What’s in store for you?

This whitepaper will give you a detailed understanding of the following:

  • BizTalk Message Context Properties
    • What are Property fields and how to promote properties?
    • What are distinguished fields and how to create a distinguished field?
    • Summary of differences between Property Fields and Distinguished Fields
  • System property schema and properties
  • Error Report property schema and properties
  • Legacy schema and properties
  • Microsoft BizTalk XLANGs BTXEngine schema and properties
  • Message Tracking schema and properties
  • BizTalk Framework Schema and Properties
  • MIME-SMIME Property Schema and Properties
  • XML and Flat File Property Schema and Properties
  • File adapter property schema and properties
  • FTP Adapter Property Schema and Properties
  • HTTP Adapter Property Schema and Properties
  • MQSeries Adapter Property Schema and Properties
  • MSMQ Adapter Property Schema and Properties
  • POP3 Adapter Property Schema and Properties
  • SMTP Adapter Property Schema and Properties
  • SFTP Adapter Property Schema and Properties
  • SOAP Adapter Property Schema and Properties
  • SQL Adapter Property Schema and Properties
  • WCF Adapters Property Schema and Properties
  • Windows SharePoint Services Adapter Property Schema and Properties
  • Azure Service Bus Adapter Property Schema and Properties
  • Azure Blob storage Adapter Property Schema and Properties
  • Azure Event Hubs Adapter Property Schema and Properties
  • Office 365 Outlook Calendar Adapter Property Schema and Properties
  • Office 365 Outlook Contact Adapter Property Schema and Properties
  • Office 365 Outlook Email Adapter Property Schema and Properties
  • SharePoint Online Adapter Property Schema and Properties
  • Microsoft BizTalk Accelerator for HL7 (BTAHL7) Property Schema and Properties
  • How to write or promote properties in the context of a messages through the BizTalk API
    • Promote method
    • Write method
    • Property Schema Base

Where I can download it

You can download the whitepaper here:

I hope you enjoy reading this paper and any comments or suggestions are welcome.

Receive Location Name Property Promotion Pipeline Component

Receive Location Name Property Promotion Pipeline Component

I just updated my BizTalk Pipeline Components Extensions Utility Pack project available on GitHub with a new component: Receive Location Name Property Promotion Pipeline Component.

For those who are not familiar, this project is a set of custom pipeline components (libraries) with several custom pipeline components that can be used in received and sent pipelines, which will extend BizTalk’s out-of-the-box pipeline capabilities.

Receive Location Name Property Promotion Pipeline Component

Receive Location Name Property Promotion Pipeline Component is a simple pipeline component to promote the Receive Location Name (ReceiveLocationName) property to the context of the message. Several BizTalk Server context properties are not promoted by default with BizTalk Server, which means that they are not available for routing. 

One such property is the ReceiveLocationName property. While the ReceivePortName property is available in the BTS namespace, the ReceiveLocationName property is not promoted. It cannot be used for routing nor access it from inside an orchestration.

My team and I kept that behavior creates this project as a proof-of-concept to explain how you can promote properties to the context of the message.

Create a Property schema

To promote properties to the context of the message, we will need a Property Schema with these properties. In our case, we will add only one property called: ReceiveLocationName.

Property Name Date Type Property Schema Base
ReceiveLocationName xs:string MessageContextPropertyBase

Note: A MessageContextPropertyBase property means that the XPath may or may not exist. 

Create a Pipeline Component

To actually promote the properties to the context of the message, we need to create a pipeline component to do the trick.

string rlocationname = (string)pInMsg.Context.Read("ReceiveLocationName", "http://schemas.microsoft.com/BizTalk/2003/system-properties");
pInMsg.Context.Promote("ReceiveLocationName", "https://BizTalk.Pipeline.Components.RcvLocationPromotion.PropertySchema", rlocationname);

How to use it

Once you deploy the property schema and a receive pipeline component containing the Receive Location Name Property Promotion Pipeline Component, you can start to apply Content-based routing using the Receive Location Name.

Download

THIS COMPONENT IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND.

You can download Receive Location Name Property Promotion Pipeline Component from GitHub here:

BizTalk Property Schema Error: The type name ‘…’ does not exist in the type ‘System’

BizTalk Property Schema Error: The type name ‘…’ does not exist in the type ‘System’

I’m just playing with BizTalk Server doing a small proof-of-concept using BizTalk Server and Azure Service Bus, and I was surprised with a few bunches of errors while I tried to compile my simple project:

Severity Code Description Project File Line Suppression State
Error CS0426 The type name ‘SerializableAttributeAttribute’ does not exist in the type ‘System’ POC.BizTalk.AzureServiceBus C:DEVPOCPOC.BizTalk.AzureServiceBusPOC.BizTalk.AzureServiceBusSchemasASBPropertySchema.xsd.cs 9 Active
Severity Code Description Project File Line Suppression State
Error CS0426 The type name ‘Xml’ does not exist in the type ‘System’ POC.BizTalk.AzureServiceBus C:DEVPOCPOC.BizTalk.AzureServiceBusPOC.BizTalk.AzureServiceBusSchemasASBPropertySchema.xsd.cs 85 Active

Were is the full error list:

  • The type name ‘SerializableAttributeAttribute’ does not exist in the type ‘System’
  • The type name ‘SerializableAttribute’ does not exist in the type ‘System’
  • The type name ‘NonSerializedAttributeAttribute’ does not exist in the type ‘System’
  • The type name ‘NonSerializedAttribute’ does not exist in the type ‘System’
  • The type name ‘NonSerializedAttributeAttribute’ does not exist in the type ‘System’
  • The type name ‘NonSerializedAttribute’ does not exist in the type ‘System’
  • The type name ‘SerializableAttributeAttribute’ does not exist in the type ‘System’
  • The type name ‘SerializableAttribute’ does not exist in the type ‘System’
  • The type name ‘NonSerializedAttributeAttribute’ does not exist in the type ‘System’
  • The type name ‘NonSerializedAttribute’ does not exist in the type ‘System’
  • The type name ‘Xml’ does not exist in the type ‘System’
  • The type name ‘Xml’ does not exist in the type ‘System’
  • The type name ‘Type’ does not exist in the type ‘System’
  • The type name ‘SerializableAttributeAttribute’ does not exist in the type ‘System’
  • The type name ‘SerializableAttribute’ does not exist in the type ‘System’
  • The type name ‘NonSerializedAttributeAttribute’ does not exist in the type ‘System’
  • The type name ‘NonSerializedAttribute’ does not exist in the type ‘System’
  • The type name ‘Xml’ does not exist in the type ‘System’
  • The type name ‘Xml’ does not exist in the type ‘System’
  • The type name ‘Type’ does not exist in the type ‘System’
  • The type name ‘SerializableAttributeAttribute’ does not exist in the type ‘System’
  • The type name ‘SerializableAttribute’ does not exist in the type ‘System’
  • The type name ‘NonSerializedAttributeAttribute’ does not exist in the type ‘System’
  • The type name ‘NonSerializedAttribute’ does not exist in the type ‘System’
  • The type name ‘Xml’ does not exist in the type ‘System’
  • The type name ‘Xml’ does not exist in the type ‘System’
  • The type name ‘Type’ does not exist in the type ‘System’

Cause

Initially, I have to be honest, I was not realizing why this error was happening, mainly because the main error description may elude us and point us to DLL reference problems: Xml, System, SerializableAttributeAttribute, and so on. But looking carefully to the error message details, all of the errors will point us to the PropertySchema file.

After realizing that, it was not difficult to realize that I had on my Property Schema an element call System. System is a reserved word that you CANNOT use inside the property schemas.

Solution

The solution to this issue is quite simple, you need to:

  • Rename your System element inside your Property Schema to another word, for example ExtSystem
  • Of course, fix all the dependencias inside your project, if you were already using this element iside your solution, for example Message Assigment shape
  • and finally compile the project

The post BizTalk Property Schema Error: The type name ‘…’ does not exist in the type ‘System’ appeared first on SANDRO PEREIRA BIZTALK BLOG.