Showing posts with label BizTalk. Show all posts
Showing posts with label BizTalk. Show all posts

Difference between include and import elements in XML Schema - XSD with Example

As we all know that include and import elements in a xsd is used to reference schema components from another schema,
In this post I will explore the difference between them and when to use what with simple examples and how we can use the same in BizTalk Server.

Include element - include refers to declarations or definitions that are from same namespace or a no target namespace.
That is if the Schema being added also contains elements with same namespace then we can directly include it.
XSD Include means Importing types from another schema within the SAME namespace
When we are referring to the declarations or definitions from the same namespaces then we use Include element.

Import element - import refers to declarations or definitions that are from a different target namespace.
The import element is used to add multiple schema's with different target namespace to a document.
XSD Import means Importing types from another schema/namespace
When we are referring to the declarations or definitions from different namespaces then we use Import element.

Resolving The FILE receive adapter deleted the empty file without performing any processing in Microsoft BizTalk Server

This error message occurs whenever BizTalk File Adapter receives a file with No Data that is 0KB.

The design of the file Adapter is such that it deletes the file if there is no data. It writes an event log.
This the default behaviour of the FILE Adapter it deletes before the pipeline stage itself hence the behavior cannot be changed.

This behavior can be overcome by writing a custom Adapter.

Following is an example of the event log when this error occurs –

File Adapter Deleted the Empty File Event Viewer

Location of Default Pipelines Assembly and its Fully Qualified Names in Microsoft BizTalk Server – Interview Question

Hi, I will explore the assembly which contains Default (Inbuilt) pipelines, its location in the GAC and how these pipelines are present in every BizTalk project folder.

It's not a major thing to know the assembly for Default pipelines, but it's good to know.

The Default pipelines are present in the assembly - Microsoft.BizTalk.DefaultPipelines.dll  
 
The assembly Microsoft.BizTalk.DefaultPipelines.dll is present in  GAC, in the below path
C:\Windows\assembly\GAC_MSIL\Microsoft.BizTalk.DefaultPipelines\3.0.1.0__31bf3856ad364e35\

DefaultPipelines.dll Location Image

How to call Receive or Send Pipelines inside Orchestration in Microsoft BizTalk Server, Using ExecuteReceivePipeline and ExecuteSendPipeline methods of XLANGPipelineManager class for implementing Composed Message Processing Enterprise Integration patterns

Hi everyone, in this post I will explain how to call Pipelines inside Orchestration

This post is very important to understand the implementation of Composed message processing Enterprise Design Pattern, where we use all the below explained concepts.

There are times, when we need to call custom or inbuilt pipelines inside the orchestration in scenarios such as
1) We need to call an external assembly that returns a string and you need to convert it into XML and create a message from it
2) To perform debatching inside the orchestration.
3) To perform batching of messages (assemble multiple messages).
4) To call a custom pipline like that has the functionality of logging of the messages created inside Orchestration,

BizTalk engine provides the XLANGPipelineManager for the execution of pipelines inside the Orchestration.
This class is present inside the assembly Microsoft.XLANGs.Pipeline

How to use Filter Expression property in Receive Shape (using Promoted Properties) of an Orchestration in BizTalk Server / Resolving illegal ‘activate’ predicate error – Sample Application Walkthrough

Hi Everyone, In this post I will show how to configure the Filter Expression property of a Receive Shape, so that based on the value of the incoming message, particular orchestration will be started.

This application is based on the one of my requirement in office as we had to re-use the schemas for different business purposes.

In this application there are two Orchestration and based on the value of one of the element from the Incoming message (this value is to be property promoted) respective Orchestration is fired.
If the value of the NotificationReceiver is 1 THEN Orchestration 1 will be Fired
If the value of the NotificationReceiver is 2 THEN Orchestration 2 will be Fired

Difference between Atomic Transaction versus Long Running Transaction in BizTalk Server - Quick Interview Question

Hi this post explores the difference between Atomic and Long Running transactions

Difference between Atomic Transaction  and Long Running Transaction 
Atomic supports ACID properties - Enables a transaction to automatically role back to a previous state in case the transaction does not successfully complete.
Long Running supports only Consistency and Durability – No automatically role back
Atomic supports calling of Non serializable dot net classes
Long running does not support non serializable dot net classes
Atomic transaction does not support nesting of transactions.
It can contain scope with Transaction - none
Long running transaction supports nesting of transaction, it can contain both long running or atomic transaction.
Atomic transaction scope can have only Compensation blocks.
Long running transaction can have both exception handling blocks as well as compensation blocks.
Atomic transaction scopes are always synchronized. (i.e. Synchronized property is true)
In Long Running transaction scopes we need to set the synchronized property to true or false.
Atomic have short execution time
Atomic have short to long execution time
Acquires data locks on Resource Managers (ex: SQL Server)
Does not acquire any data locks
Managed via Transaction Manager (ex:Microsoft Distributed Transaction Coordinator - MSDTC)
No Transaction Manager Required
Operations succeed (commit) or fail (rollback) as a unit
Operations succeed (commit) or fail (rollback) independently

XML Design Consideration – What Should be used XML Elements or Attributes - BizTalk Schema Design Consideration

The choice of Element or Attribute for a data depends on different factors like -

1) Attributes take up only about half the space that elements take up.
This is because an attribute called OrderNumber will have the word OrderNumber only once, whereas
Element will have both a start tag and an end tag, meaning that the word OrderNumber will appear twice, in the opening and closing brackets for the tags. 
Hence the file size is comparable more if elements are used.

2) Elements can occur multiple times, attributes cannot, that is an element cannot contain multiple attributes with same name.

3) Property promotion in BizTalk works only for elements and not for attributes.

4) The structure of the external system to be integrated.

Links -

XML Elements, Attributes, and Types (XML Designer)

How to get the root node name of an xml document /node name of any xml element using XPath name() function in Expression Shape BizTalk Server with Examples

Hi, this posts explains how to use XPath Expressions to get the Node Name of an XML Document.
The Xpath expression can be used inside the Expression shape of BizTalk server using the xpath function.

If the business process is tied to the XML then Root Node name can be used to identify the business process being executed in BizTalk Server.

We can get the Root Node name or name of any node using the name() function, by passing  XPath as input parameter

Syntax:
name(XPath Expression)

Example

Input XML
<OrderId>
<OrderRecord>
       <Place>ALT</Place>
       <Date>21-Aug-2011</Date>
</OrderRecord>
<OrderNo>123</OrderNo>
</OrderId>
i) name(/*) 
Result: OrderId

ii) name(/*/*)
Result: OrderRecord

iii) name(/*/*[2])
Result: OrderId


What is Default Application - BizTalk Application 1 and System Application - BizTalk.System in BizTalk Server


Introduction –

Hi all, In this post I will explain concepts of Application in BizTalk , Default BizTalk Application, System/Built in Application containing built in artifacts like Pipelines, Schemas etc.

Description -

Application in BizTalk Server

A BizTalk application is a logical grouping of the related items, called "artifacts" that are used in a BizTalk Server business solution.
Artifacts in BizTalk are schemas, maps, orchestrations, and pipelines etc are called as artifacts. These are called as artifacts since these get converted into C# code internally.


When we deploy the BizTalk application the BizTalk artifacts are also installed into the GAC.

In General, we can have all the artifacts grouped under one BizTalk Application but the problem with this approach is that as the number of artifacts increases it becomes difficult for us to manage, hence to overcome we group these artifacts into applications. So that maintenance will be easy.

Difference between Enlisting, Starting, Stopping, and Unenlisting subscribers (Ports, Orchestration) in BizTalk Server

Introduction -

Hi Everyone, In this post I will explore the different states a subscriber like Port, Orchestration etc can be have.
I had to do a lot of research, to write this post and also it took me considerable time to write.

Description -

Publishers like Receive ports can be enabled or disabled, where as
Subscribers like Send ports, Orchestration can be enlisted, started, unelisted or stopped.
Enlist means Create Subscription in MessageBox.
Unenlist means Remove Subscription from MessageBox.

Let’s look into the functionality by taking a Subscriber

Scenario 1) Started - When a subscriber is Started, the subscriber is enlisted also this means that the message box can receive any messages on behalf of the subscriber. Hence the message flows smoothly through the Message box.

Default Fully Qualified Name, Target Namespace and Message Type for a XML Schema in BizTalk Server

Introduction -

Hi in this post I will explore the Default values that BizTalk assigns for the Target Namespace, Fully Qualified name Message type for a XML Schema in BizTalk Server.
It is important to know these properties while we are copying the Schema file from one project to another or when we get a subscription not found error..

Description -

Fully Qualified Name

The default Fully Qualified name is a combination of Namespace of the Schema file and the Name of the Schema file concatenated by a dot.

Syntax: NamespaceOfTheSchemaFile.SchemaFileName

Target Namespace

The default Target namespace is a combination of FullyQualifiedName prefixed by “http://”

Syntax: http://FullyQualifiedName          i.e.
             http://NamespaceOfTheSchemaFile.SchemaFileName

Importing and Exporting MSI files from or to a BizTalk application using BTSTask command in BizTalk

Introduction -

Hi everyone, in this post I will explore the process of Importing and Exporting MSI files to/from a BizTalk application using the BTSTask command.
  
Description -

The above tasks of importing/exporting are accomplished using the command BTSTask in this post.
The same can be done using the BizTalk administration console also, the reason I am using the command prompt is to get familiar with the usage of the command BTSTask, which is one of the most widely, used commands by BizTalk administrators.

DIfferent Namespaces in XML Schema

Introduction -

Hi Everyone, in this post I will explore the structure of XML Schema language and namespaces in a schema language.
It is suggested the reader to have basic understanding of namespaces in XML and also knowledge about XML Schema.
If the reader is not familiar about XML Namespaces please refer to my earlier post titled "Namespace in XML"

Description -

Defn - XML Schema is a XML based language used for defining the structure of an XML document.

In a XML Schema language the first element should always be the element with name "schema" and this element comes immediately after the XML declaration.
The element contains attributes and has few namespaces that complete the XML Schema document. 

What are Namespace in XML and Different ways of adding Namespace to a XML

Introduction

Namespace in XML gives uniqueness to the elements/attributes.
Namespace in XML can be compared to packages in java or namespaces in DotNET.
Namespace in a xml document are declared using attribute xmlns and any prefix character.

Syntax -  xmlns:prefix="URI"

here, xmlns stand for XML Namespace
and prefix can be anycharacters

Example - 

<?xml version="1.0"?>

<root xmlns:nm1="http://www.web1.com"
xmlns:nm2='http://www.web2.com">
<nm1:elem1>Element 1</nm1:elem1>
<nm2:elem2>Element 2</nm2:elem2>
<nm1:elem3>Element 3</nm1:elem3>
<nm2:elem4>Element 4</nm2:elem4>
</root>