New Technet wiki “BizTalk Server:Performance Tuning & Optimization”

In the series of Technet WIki articles , I have published my another article today “BizTalk Server: Performance Tuning & Optimization” It is all about BizTalk Server performance optimization and tuning. The article features following things which might be helpful while working with performance tuning and optimization with BizTalk Server product.

  • Identifying Performance bottlenecks
  • Guide of resolving performance issues
  • MSDN articles and Guide about performance tuning
  • Various articles about optimizing BizTalk server code and solutions
  • Links to various Blog Posts about tuning and optimization

Feel free to read and contribute!!

Thanks for reading!

My New Article on Technet-Microsoft BizTalk Server:ESB Survival Guide

In the series of Technet WIki articles , I have published my another article today “Microsoft BizTalk Server:ESB Survival Guide“. It is all about BizTalk Server and ESB. The article features following things which might be helpful while working with ESB and BizTalk.

  • Installation and Configuration of ESB
  • Links to various Blog Posts about configuration issues and Samples
  • MSDN links for the installation and Overview

Feel free to read and contribute!!

Thanks for reading!

BizTalk Schema to use <any> element

Overview

The XSD <any> element is very useful while designing generic schema or a schema to contain something unexpected/undefined or set of defined XML or elements.

The <any> element provides a way to keep/contain XML element which is not defined in the schema. For more details and example, Please read here :

Problem

There is a requirement to design a schema which should be generic in nature to contain any undefined type of XML. For example the following XML should be able to contain any XML in the <Details> element. As in the below example it contains <feedtext> element

schema input-1

The XM: should be able to contain any other XML in the <Details> as below a different input:

schema input-2

As in the above input XML , it contains <feedtextfromsite1>

Solution

To cater the above requirement we have to use <any> element in our schema . As defined in the page here, If a element is defined as <any> It can contain any other XML which is not defined in the schema.

Code

We will start by creating a schema using BizTalk Schema editor , Below are few steps:

  1. Create the Root Element and name it “MyBlogRssFeeds”
  2. Insert a  record and rename it to “Header”
  3. Insert a record below “Header”
  4. Insert a record below root element and name it “Details”
  5. Insert <any> element by Right Click on <Details>, then select “Insert Schema Node” then select “Any Element” .
  6. After this the schema should look like below:

Schema

And with this I was able to create a generic schema and was able to validate my XML.

And One More Thing!!

Please pay attention of the properties of <Any> element: It should look like below:

Schema Final

The property “Process Contents” should be set to “Skip” . Because of course we do not want the XML engine to validate the structure of this element.

the definition of this property is below from this page :

“Indicates how XML from other namespaces (introduced by the any element in a content model) should be validated. The value for this attribute may be one of ‘strict’ (the processor must retrieve the schema declaration associated with the namespace and validate the XML); ‘lax’ (the processor should attempt to validate the XML against its schema); and ‘skip’ (the processor should not attempt to validate the XML) “

Thanks for reading!

DebugView Not working on Windows 7 64 bit

Mostly I use DebugView while developing my BizTalk projects for quick trace and logging purpose. However recently I had a strange experience with DebugView.

I started my BizTalk application of one of our Windows 7 machine and DebugView was not showing any output while execution. I dig a lot ,however nothing was working for me and it was becoming very touch for me to follow the trace of the application.

Then after trying different settings on DebugView, it finally started to show the output. The settings which i changed on DebugView is:

  • Started running DebugView with administrator rights on machine
  • Enabled “Capture Global Win32” from the menu.

Please see this blog post, about how to use DebugView.

Thanks for reading!

BizTalk Rule Engine Policies Not Working

I recently created one policy and deployed on my another development Box, But it was strange, because it was not modifying my input XML.

I checked the logic of my rule and imported few times, Also restarted my Rule Engine Services, however it did not work for me. The only change which i was doing is, deploying on a different operating system. My other development Box was running Windows 7, 64 bit.

I searched a lot about the issue but did not find much information.

My Rule us using XmlHelper class to modify the input xml using some decisions based on the supplied values in xml file.

Finally after searching more about this class, I figured out the problem and fixed it. The steps are below:

  • I had to make some changes in my registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\BusinessRules\3.0\StaticSupport

  • I created the key and it started working fine.

About the Registry Key:

I had to set the value 2 of the above registry key, which tells BizTalk Rule engine to support usage of static objects , details are:

  • 2 – An instance of the object is NOT required, but the static method will be called at rule translation time (only if the parameters are constants). This is primarily meant as a performance optimization. However, note that static members used as actions will NOT be executed at translation time, but static methods used as parameters may be.

The Key was not there in my registry So i have created and set the value 2, It started working.

Finally I found more details about this problem in a blog post here by Richard. Please see the blog post for more details.

My First Article on Technet-BizTalk Server:Integration with MQ Series

I have published my first article on Microsoft Technet site today. In summary the article covers following points

  • What to use MQSC or MQSeries Adapter
  • List of common Hot fixes from Microsoft related with MQ Adapter
  • List of useful MSDN articles
  • List of useful discussions on msdn social forum
  • List of useful blog post by BizTalk community members

Please feel free to read and update the “BizTalk Server:Integration with MQ Series” wiki article.

Filter Unique Records Using BizTalk XSL

  • Requirement

I have a XML file which contains some duplicate records. The XML file looks like below:

<ns0:DataNode xmlns:ns0=”https://alamnaushad.wordpress.com/DataNode”>
    <ns0:MainNode>
        <ns0:ID>123</ns0:ID>
        <ns0:name>First Index</ns0:name>
    </ns0:MainNode>
    <ns0:MainNode>
        <ns0:ID>123</ns0:ID>
        <ns0:name>Second Index</ns0:name>
    </ns0:MainNode>
    <ns0:MainNode>
        <ns0:ID>123</ns0:ID>
        <ns0:name>Last Index</ns0:name>
    </ns0:MainNode>
    <ns0:MainNode>
        <ns0:ID>1234</ns0:ID>
        <ns0:name>First Index</ns0:name>
    </ns0:MainNode>
</ns0:DataNode>

The requirement here to get only unique records based on the value of ID element. Also We have to get the last occurrence of ManinNode for which ID is unique in the XML.

After the MAP Output should be like below XML

<ns0:DataNode xmlns:ns0=”https://alamnaushad.wordpress.com/DataNode“>

<ns0:MainNode>

<ns0:ID>123</ns0:ID>

<ns0:name>Last Index</ns0:name>

</ns0:MainNode>

<ns0:MainNode>

<ns0:ID>1234</ns0:ID>

<ns0:name>First Index</ns0:name>

</ns0:MainNode>

</ns0:DataNode>

  • Solution Approach

    I would write a custom XSL to achieve the above requirement . To get the last occurrence of from a node set I would use last() xsl function.

  • Code

      I would perform following steps to create a MAP and use the XSL in MAP to achieve my requirement.  My XSL code looks like below
         

      <?xml version=”1.0″ encoding=”UTF-16″?>
      <xsl:stylesheet xmlns:xsl=”http://www.w3.org/1999/XSL/Transform” xmlns:msxsl=”urn:schemas-microsoft-com:xslt” xmlns:var=”http://schemas.microsoft.com/BizTalk/2003/var” exclude-result-prefixes=”msxsl var” version=”1.0″ xmlns:ns0=”https://alamnaushad.wordpress.com/DataNode”>
          <xsl:output omit-xml-declaration=”yes” method=”xml” version=”1.0″ />

          <xsl:key name=”item-by-value” match=”ns0:ID” use=”.”/>
          <xsl:template match=”/”>
              <ns0:DataNode>
              <xsl:apply-templates select=”/ns0:DataNode/ns0:MainNode/ns0:ID” />
              </ns0:DataNode>
          </xsl:template>
              <xsl:template match=”ns0:ID”>
                  <xsl:for-each select=”.”>
                      <xsl:if test=”generate-id() = generate-id(key(‘item-by-value’, normalize-space(.))[last()])”>
                      <ns0:MainNode>
                          <ns0:ID>
                              <xsl:value-of select=”.” />
                          </ns0:ID>
                          <ns0:name>
                              <xsl:value-of select=”following-sibling::*”/>
                          </ns0:name>
                      </ns0:MainNode>
                      </xsl:if>
                  </xsl:for-each>
          </xsl:template>
      </xsl:stylesheet>

    1. Created a Schema to hold the input xml message
    2. Created A Map to transform the input to desired output
    3. Created a XSL file which contains all my transformation logic
    4. Set the property of BizTalk Map to use the custom XSL file Path like below.

    2-24-2012 12-23-18 AM

    I have uploaded the complete project here, Please download and feel free to use it!!

     

      Uninstall XCode-Completely

      Following command can be used to uninstall XCode (any version) from your MAC.

      sudo /Developer/Library/uninstall-devtools –mode=all

       

      A great article for BizTalk Questions

      If your are going for an Interview, These concepts and questions might help you ..

       

      http://geekswithblogs.net/LeonidGaneline/archive/2012/01/10/biztalk-advanced-questions.aspx