Monday, 4 May 2015

Remove Header from CSV File in Biztalk

Hello Friends,

Please see below sample data which you receive in a flat file.

FName,MName,LName
John,K,Cena
Rambo,D,Parera

As you can see that first row is heading Like Fname,MName and LName. so when you do mapping then heading will be also mapped as data in target schema.

What my requirement is that I dont want to Include Heading in my output. I want only the exact data from the CSV file which I am receiving. for example only 2nd and third row.

I want Output as Below:




To achieve this target I have created one flat file schema and one target schema and mapped it. The step by step details I am attaching below:

Step 1: Add New Item and select Flat File Schema Wizard, give any name.



Step 2: In Flat File Schema Information Window Change the record Name and select the input Instance.
Step 3: In Select Doccument Data window Select the heading and and and first row after heading.


Step 4: Select Record Format By Delimiter Symbol.

Step 5: In Delimiter Record Select child Delimiter as CR LF.
Step 6: In Child Elements Window change the name as "Header" and the element Type of Header to "Record" and change the element type of exact date to "Repeating Record".

Step 7: In Schema View Select the Header and Click Next.

Step 8: In Select Document Data Window select the Header and click next.

Step 9:In Delimited Record select Child Delimiter as comma(,)
Step 10:In child Elements Window leave as it is or you can change the name and click next.

Step 11: Now select the Emp Node and click Next.
Step 12: In select doccument data window select the second row and click next.
Step 13: select , in Child Delimiter.
Step 14: In child Element window you can change the element name as required.
Click Finish to complete the wizard.

The source schema will look like as below:

Now Create a Target Schema same as below:
Now we will add a map to our project and will choose the source schema and target schema.

The mapping will be like below:

As you can see in above map we are not mapping the Header to Target schema so the heading will not come in target output.

we will get our required output without first row i.e Heading.

Our Output Will be Like below:



I hope I am clear in this demo. This is Sample one you can take it as a reference and complete your requirement.


Event ID List of Common Warnings and Errors In Biztalk

Hello Friends,

Here in this list you can find some common Error details which is associated with same Event ID. 
For Example when you see EVENT ID 5740 you can see that this event id is same but Error Details are different.

Event ID
Error Details
Type
5740
The adapter "FTP" raised an error message. Details "Unable to connect to FTP server "X.X.X.X" as user "TESTUSER” Inner Exception details: "No FTP server found on the specified address. ". ".
Warning
5740
The adapter "FTP" raised an error message. Details "The folder "Test Folder" does not exist. ".
Warning
5740
The adapter "FTP" raised an error message. Details "The adapter recovered from recent failures. The Event Log Error Threshold count reset. ".
Warning
5740
The adapter "FTP" raised an error message. Details "Unable to receive the file "Test File Name" from the FTP server.  The error that occurred was "A stream read or write operation failed because the stream is in an error state.
Warning
5740
The adapter "FTP" raised an error message. Details "A failure occurred when parsing the remote folder listing. Inner Exception details: "An error occured while receiving a reply line from the FTP server. ". ".
Warning
5649
The receive location "RcvLocation" with URL "Test URL" is shutting down. Details:"The error threshold was exceeded. ".
Error
5410
An error occurred that requires the BizTalk service to terminate. The most common causes are the following:
 1) An unexpected out of memory error.
 OR
 2) An inability to connect or a loss of connectivity to one of the BizTalk databases.
 The service will shutdown and auto-restart in 1 minute. If the problematic database remains unavailable, this cycle will repeat.
Warning
5719
Unable to receive the file "Test File Name" from the FTP server.  The error that occurred was "The data transfer has been aborted by the FTP server. ".
Error
5719
Unable to receive the file "Test File Name" from the FTP server.  The error that occurred was "A stream read or write operation failed because the stream is in an error state. ".
Error
5743
The adapter failed to transmit message going to send port "Test Send Port" with URL "Test URL". It will be retransmitted after the retry interval specified for this Send Port. Details:"The folder "Test Folder" does not exist. ".
Warning
5753
There was a failure executing the receive pipeline: Reason: Unable to receive the file "Test File Name" from the FTP server.  The error that occurred was "The data transfer has been aborted by the FTP server. ".
Error
5753
There was a failure executing the receive pipeline: Reason: Unable to receive the file "Test File Name" from the FTP server.  The error that occurred was " The remote file could not be opened by the FTP server. ".
Error
5754
The remote server refused a data connection.Please check permissions on the remote system.
Error
5754
The folder "Test Folder" does not exist.
Error
5754
"A message sent to adapter "Test Addpter" on send port ORA-06508: PL/SQL: could not find program unit being called: ""PUBLIC.OWA_UTIL""
Error
5792
The Messaging Engine encountered an unexpected error while trying to suspend messages received by adapter "FTP" that failed due to routing failure. Details: "An error occurred when accessing the part data or one of its fragments. The part data or fragment may not exist in the database. ".
Error







6998
"Unable to communicate with MessageBox BizTalkMsgBoxDb on SQL Instance <test Name>. Error Code: 0xc0c01b45. Possible reasons include:
 1) The MessageBox is unavailable.
 2) The network link from this machine to the MessageBox is down.
 3) The DTC Configuration on either this local machine or the machine hosting this MessageBox is incorrect."
Error
10034
ORA-06508: PL/SQL: could not find program unit being called: "SYS.OWA_CX",ORA-06508: PL/SQL: could not find program unit being called: "PUBLIC.OWA_UTIL"
Error

Wednesday, 18 March 2015

Get Body of the suspended message in Biztalk programmatically using C#

Hi Friends,

Sometimes there may be situation when there are many suspended messages in Biztalk and sometimes we need to extarct the body of those suspended message programmatically.

I had also this situation so I wrote one code that helped me. I am sharing this code may be U can get some reference from this code and customize it as per your requirement.

In My Condition I am just getting the message instanceId and message body of suspended message and displaying in gridview.

I have taken one Web Application and after adding the webform in my web application I took a gridview as below:




























In code behind file you need to use below code---

Please dont forget to add below to dll file....

using Microsoft.BizTalk.Message.Interop
using Microsoft.BizTalk.Operations

























As you can see there is BindGrid() method I have created. you can see the code and you can use this method in your program to get the body of any supended message in biztalk.

Thank you for reading this.


Tuesday, 10 March 2015

FTP Adapter Common Error BizTalk server

You receive a "Failure occurred in parsing the remote folder listing" error message when you try to retrieve documents from or send documents to an FTP server

Problem
When you try to retrieve documents from or send documents to an FTP server by using the Microsoft BizTalk Server  FTP adapter, you receive an error message that is similar to the following:
A failure occurred in parsing the remote folder listing.
Cause
You may receive this error message if the following conditions are true:
  • The receive handler or the send handler for the BizTalk Server FTP adapter is configured to use a firewall mode of Passive.
  • The target FTP server does not permit passive connections.
Resolution
To resolve this behavior, use one of the following methods:
  • Configure the receive handler or the send handler, or both, for the BizTalk Server  FTP adapter to use a firewall mode of Active.
  • Configure the target FTP server to permit passive connections.
The FTP adapter can be used to connect to FTP servers on systems ranging from Solaris and Linux to AS/400. For more information about connecting to legacy systems, see Configuring an FTP Adapter to Work with Legacy Hosts.

FTP receive adapter fails to publish message if receive pipeline processing time exceeds server time-out

Problem
A message received via the FTP adapter is not published to the MessageBox database. 
Cause
The time taken to complete pipeline processing exceeds the FTP connection time-out.
Resolution
Use one of the following methods to mitigate this problem:
  • Increase the connection time-out value. Set the idle time-out value on the FTP server to be at least the amount of the time it takes to process the file.
  • Use the Temporary Folder feature on the receive location. In this case, the FTP adapter copies the file to the temporary folder (typically the local disk). It typically takes less time to copy the file to the local disk than to run the message through the pipeline and persist it to the MessageBox database, which effectively reduces the idle time. 

Thursday, 19 February 2015

BizTalkBeginners: Splitting Delimited Values of single node in BizTa...

BizTalkBeginners: Splitting Delimited Values of single node in BizTa...: Hello Friends, Today I got a situation where I have a address node in which complete address was stored with comma(,) separated like &qu...

Splitting Delimited Values of single node in BizTalk Maps and map to multiple nodes


Hello Friends,

Today I got a situation where I have a address node in which complete address was stored with comma(,) separated like "Madhapur, Hyderabad, India".
What I wanted to do is that extract every single separted with comma and map to different different node to target schema.

For Example, "Madhapur" to "City" node
                       "Hyderabad" to "State" node
                       "India "          to "country" node in Target Schema.

For yor better I am attaching sample screenshots here.

1. This is the input file for map
As you can see in this xml file that we have node called Address under which we have value stored 

"Madhapur, Hyderabad, India" with comma separated.

2.  Screenshot of Map

As you can see that in target schema "TargetAddress" we have three nodes City, State and Country in which I am assigning three different values which is stored under Address in source schema with comma separated by using scripting functiod.

Now what you have to do is.Just take 3 different scripting functoids and place it on the map.

------Code for First Scripting Functoid..i.e for City Node.------

public string City(string str)
{

           string[] words = str.Split(',');
            string result= words.GetValue(0).ToString();
            return result;
}

------Code for First Scripting Functoid..i.e for State Node.------


public string State(string str)
{

           string[] words = str.Split(',');
            string result= words.GetValue(1).ToString();
            return result;
}


------Code for First Scripting Functoid..i.e for Country Node.------


public string Country(string str)
{

           string[] words = str.Split(',');
            string result= words.GetValue(2).ToString();
            return result;
}



when you use these three scripting functoids we will get our desired results as below:


As you can see that these values has been mapped to respective nodes.


Thank you for reading this.

Anshu Kumar