Ravindar, Biztalk Developer and Administrator

Just another BizTalk blog

Multilevel xpath filtering

when you want to do multilevel filtering, make sure you embed the multilevel element structure in brackets inside the filter box []

 

/*[local-name()=’BankPartyProductChangedEvent’ and namespace-uri()=’test’]/*[local-name()=’DataArea’ and namespace-uri()=’test’]/*[local-name()=’CommonData’ and namespace-uri()=’test’]/*[local-name()=’LocationList’ and namespace-uri()=’test’]/*[local-name()=’Location’ and namespace-uri()=’test’][(*[local-name()=’AddressReference’]/@*[local-name()=’referenceKey’])=’1′]/@*[local-name()=’key’ and namespace-uri()=”]

 

Advertisements

May 25, 2017 Posted by | Uncategorized | Leave a comment

Concatenate repeating node with a delimiter

<xsl:element name="ns0:Dummy">
     <xsl:for-each select="/s0:BankPartyProductChangedEvent/s0:DataArea/s0:PartyList/s0:Party/s0:DataProtectionList/s0:DataProtection">
         <xsl:if test="position()>1">
             <xsl:value-of select="','"/>
         </xsl:if>
         <xsl:value-of select="s0:DataTypeCode/text()"/>
      </xsl:for-each>
<xsl:element>

May 23, 2017 Posted by | Uncategorized | Leave a comment

Convert input message to a string from map

I have seen users asking for a requirement, where they want the entire incoming message to be converted to string and mapped to a node in destination field in BizTalk Map.

You can refer this to achieve it

 

also there is another simple method that you can implement in Inline Xslt

 


<xsl:element name="targetElementname" >

<xsl:text disable-output-escaping ="yes">&lt;![CDATA[</xsl:text>

<xsl:copy-of select="//*[local-name()='TRANSACTION' and namespace-uri()='']"/>  (this is the xpath of the source node  which we want to copy underlying node xml structure)

<xsl:text disable-output-escaping ="yes">]]&gt;</xsl:text>

</xsl:element>

June 11, 2015 Posted by | Uncategorized | Leave a comment

How to create ‘for’ loop in Biztalk map using functiods

http://blogs.msdn.com/b/pedram/archive/2006/12/27/how-to-create-a-for-loop-in-biztalk-mapper.aspx

June 10, 2015 Posted by | Uncategorized | Leave a comment

access Ports from Powershell

A user asked in the forums here how to access ports through wmi.

my sample solution to access ports is below


Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer catalog = new Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer();

foreach (Microsoft.BizTalk.ExplorerOM.Application application in catalog.Applications)
            {


                foreach (Microsoft.BizTalk.ExplorerOM.ReceivePort recport in application.ReceivePorts)
                {
                    foreach (Microsoft.BizTalk.ExplorerOM.ReceiveLocation recloc in recport.ReceiveLocations)
                    {
                        System.Console.Write(recloc.Address);
                    }

                }



                foreach (Microsoft.BizTalk.ExplorerOM.SendPort sendport in application.SendPorts)
                {
                    System.Console.Write(sendport.PrimaryTransport.Address);
                }


            }


Also another user asked here wanted to unbound an orchestration completely programmatically. here is the solution

[void] [System.reflection.Assembly]::LoadWithPartialName("Microsoft.BizTalk.ExplorerOM")

#=== Connect to the BizTalk Management database ===#

$Catalog = New-Object Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer
$Catalog.ConnectionString = "SERVER=.;DATABASE=BizTalkMgmtDb;Integrated Security=SSPI"


$MyApplication = $Catalog.Applications["TestApp"]
$MyApplication.Stop(63)
 $Catalog.SaveChanges()
$orch = $MyApplication.orchestrations

foreach ($CurrentOrchestration in $orch)
{
    $CurrentOrchestration.Host=$null
    $CurrentOrchestration.Status = [Microsoft.BizTalk.ExplorerOM.OrchestrationStatus] "Enlisted"
    
    $CurrentOrchestration.Status = [Microsoft.BizTalk.ExplorerOM.OrchestrationStatus] "Unenlisted"
    
    
    foreach ($CurrentPort in $CurrentOrchestration.Ports)
        {            
                $CurrentPort.ReceivePort=$null
                $CurrentPort.SendPort=$null
         
        }

}
 $Catalog.SaveChanges()

January 9, 2015 Posted by | Uncategorized | Leave a comment

numbers conversion to custom decimal digits in BizTalk

In the MSDN BizTalk forums, one guy has questioned about converting a number/decimal to have predefined decimal points.

means for example if the value is 10.23, he wanted to display it as 10.2300.

one of the MSDN contributer boatseller has given excellent solution.

I’ve learnt this from the post here. the conversion code goes like below

private string formatTo4Dec(string number)
{
   double dblNumber;
   if (double.TryParse(number, out dblNumber))
   {
      return dblNumber.ToString("F4");
   }
   else
   {
     throw new System.ArgumentException(number + " is not a valid number format.");
   }
}

similarly for date time custom formats you can have a look here

June 18, 2014 Posted by | Biztalk Server | Leave a comment

BizTalk articles published in Microsoft Technet Monthly Magazine

i feel pretty much happy that two of my BizTalk articles

this and this have been published into monthly magazine by Microsoft Technet.

you can access those two full magazines here and here

June 18, 2014 Posted by | Biztalk Server | Leave a comment

HTTP adapter issues and troubleshoot

I was working to configure HTTP adapter in BizTalk 2010 and faced few issues.

After all struggle i found that the problem was with the .net client code i was using to test, its not problem with BizTalk in any way.

Note: i have learnt that if we try to configure HTTP adapter for 64bit, we need to make sure the apppool should run on .net 4.0 version.

Anyway during the course of this troubleshoot following links have really helped me

http://www.biztalkbill.com/Home/tabid/40/EntryId/66/Configuring-BTSHTTPReceive-dll-to-work-on-IIS-7.aspx

http://chibionos.wordpress.com/2009/08/30/problem-1-internal-server-error-500/

http://msdn.microsoft.com/en-us/library/aa559072(v=BTS.70).aspx

http://thebiztalker.wordpress.com/2011/01/13/configure-https-adapter-with-biztalk-server-2010/

http://tutorial.programming4.us/windows_server/biztalk-2010-recipes—adapters—configuring-http-receives.aspx

http://snefs.blogspot.in/2009/11/using-biztalk-httpreceiver.html

http://msdn.microsoft.com/en-us/library/aa559072.aspx

http://soa-thoughts.blogspot.in/2011/07/using-btshttpreceive-in-x64-environment.html

http://rohitt-sharma.blogspot.in/2011/03/biztalk-tutorial-part-7-using-two-way.html   (don’t use the .net client code given in this link, it did not work for me)

 

 

June 18, 2014 Posted by | Biztalk Server | Leave a comment

Common pipeline that can be used for validation in any BizTalk application

Nabeer has written an excellent article here about a common pipeline that can be used for validation for any schema in biztalk.

Means you can use this pipeline in any BizTalk application for validation purpose, it will validate any schema that is deployed in to biztlk.

I have tested it with multiple scenarios and it works like a charm. If your need is only to use a common pipeline that can validate, then this is a good to use

June 18, 2014 Posted by | Biztalk Server | Leave a comment

Got Silver Medal for “BizTalk Tech Guru” competetion for the month of April

I feel pretty happy and honored for gaining Silver Medal Award for “BizTalk Technical Guru”  for the month of April 2014 conducted by Microsoft. 

Image

you can have a complete list of winners at http://blogs.technet.com/b/wikininjas/archive/2014/05/17/the-microsoft-technet-guru-awards-april-2014.aspx

May 30, 2014 Posted by | Uncategorized | Leave a comment