Sunday, April 6, 2014

Error happened in body during parsing

For testing the HL7 tutorial sample , I picked sample message from following link:
http://msdn.microsoft.com/en-us/library/ee409347.aspx

MSH|^~\&|Tutorial_ADTSystem|MCM|BTAHL7InterfaceEngine||199601121005||ADT^A03|000001|P|2.3.1
EVN|A03|199601121005||01||199601121000
PID|||191919^^^MYHOS^MR~123-45-6789^^^USSSA^SS|253763|SMITH^JOHN^Q||19560129|M|||    123MAIN^^BUFFALO^NY^98052^""||(123)555-0100||S|M|10199925^^^MYHOS^AN|123-45-6789
PD1|S|F|NormalString^A^+1^-1^ISO^simpletext&Test&HCD^GI^simpletext&NormalString&ISO^I|   NormalString^Test&Test^Test^Test^Test^Test^AE^simpletext^simpletext&Test&ISO^P   ^NormalString^M10^MC^simpletext&NormalString&HCD^A|N|simpletext|I|I|N|NormalString   ^+1^M11^simpletext&NormalString&L,M,N^RRI^simpletext&NormalString&HCD|NOVALUE^NormalString   ^Test^Test^NormalString^Test|N
PV1|1|I|2000^2012^01^hey&test&DNS^test^test^test^test^test||||004777^MILLER^CONNIE^A.|||SUR||||2|A0


Error 3: Error happened in body during parsing
Error # 1
Segment Id: PD1
Sequence Number: 1
Field Number: 4
Error Number: 103
Error Description: Table value not found
Encoding System: HL70200


Error3.1: Message had parse errors, can not be serialized

Why It happened : It happened because there were space between the fields in the PD1 segment.


What to do : Remove the spaces in between the data

Tuesday, April 1, 2014

Awarded as Microsoft Integration MVP 2014 by Microsoft

Yesterday  it was Gudi Padwa (New Year) and today received a mail "Congratulations April 2014 MVP Award Winners" from Microsoft. What a start of the year. It feels great to get recognized for the job which you like to do most (helping others and sharing knowledge).

I would like to thank all the community members who share their knowledge and for the guidance  and congrats to the other community members who are also awarded as MVP along with me.

Apart from community there are many other people who I would like to thanks, like family members, my colleagues and friends who were the motivators and supportive in this journey which I started Last year .

Thanks to all .... Looking forward to learn from community and give it back what I know !!!!!!!!!

Reference : http://blogs.technet.com/b/southasiamvp/archive/2014/04/01/congratulations-april-2014-award-winners.aspx

 

Thursday, March 27, 2014

Error: Error in the application

Error: Error in the application

It was when I used BTAHL7SendPipeline on the send port to transmit HL7 file.

1. A message sent to adapter "FILE" on send port "Tutorial_BTAHL7Drop" with URI "C:\Users\tiwarmah\AppData\Local\Temp\%MessageID%.txt" is suspended.
 Error details: There was a failure executing the send pipeline: "BTAHL72XPipelines.BTAHL72XSendPipeline, BTAHL72XPipelines, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "BTAHL7 2.X Assembler" Send Port: "Tutorial_BTAHL7Drop" URI: "C:\Users\tiwarmah\AppData\Local\Temp\%MessageID%.txt" Reason: Error in the application. 
 MessageId:  {51D8E0DB-A23A-47CD-A6FD-319AFCC1B25C}
 InstanceID: {53E75E07-D0E1-4F88-B7A9-6B8701F4A397}

2.There was a failure executing the send pipeline: "BTAHL72XPipelines.BTAHL72XSendPipeline, BTAHL72XPipelines, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "BTAHL7 2.X Assembler" Send Port: "Tutorial_BTAHL7Drop" URI: "C:\Users\tiwarmah\AppData\Local\Temp\%MessageID%.txt" Reason: Error in the application

Why it happened: It is a bug in BTAHL7 Assembler, Microsoft has resolved this bug and have provided hotfixes for it.


What to do : To fix  Install the cummulative packages

Package1:
-----------------------------------------------------------
-----------------------------------------------------------
KB Article Number(s): 2838133
Language: English
Platform: i386
Location: (http://hotfixv4.microsoft.com/BizTalk%20Server%202013/latest/2838133_ENU_x86_x64/3.10.301.2/free/462362_ENU_i386_zip.exe)

Package2:
-----------------------------------------------------------
-----------------------------------------------------------
KB Article Number(s): 2892599
Language: English
Platform: i386
Location: (http://hotfixv4.microsoft.com/BizTalk%20Server%202013/latest/2892599_ENU_x86_x64/3.10.305.2/free/470061_ENU_i386_zip.exe)


Wednesday, March 19, 2014

Error : An attempt was made to load a program with an incorrect format.



There was a failure executing the receive pipeline: "BTAHL72XPipelines.BTAHL72XReceivePipeline, BTAHL72XPipelines, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "Unknown " Receive Port: "RPTest" URI: "C:\Users\tiwarmah\Desktop\TestIN\*.txt" Reason: Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft BizTalk Server 2013\Pipeline Components\Microsoft.Solutions.BTAHL7.HL72fDasm.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.


A message received by adapter "FILE" on receive location "RLTest" with URI "C:\Users\tiwarmah\Desktop\TestIN\*.txt" is suspended. 
 Error details: There was a failure executing the receive pipeline: "BTAHL72XPipelines.BTAHL72XReceivePipeline, BTAHL72XPipelines, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "Unknown " Receive Port: "RPTest" URI: "C:\Users\tiwarmah\Desktop\TestIN\*.txt" Reason: Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft BizTalk Server 2013\Pipeline Components\Microsoft.Solutions.BTAHL7.HL72fDasm.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.  
 MessageId:  {6857BA33-0489-46A6-87D8-FA2799623C50}
 InstanceID: {EC5417A2-2984-42F2-A500-539B4B7B5DFC}


Why it happened :  It happened because the BizTalk Installation is 64 bit and HL7 accelerator components are 32 bit compatible, so when default host which is 64 bit (BizTalkServerApplication) is used to contain HL7 components(32 bit) it errors. Make sure that the BizTalk host used by HL7 Accelerator is running under 32bit mode, if it is running in 64 bit mode, you will get this error.

What to do: Create a host with 32bit mode and use the instance of this host for HL7 Accelerator .


Thursday, February 20, 2014

Can we view Orchestration in C#

Orchestration in BizTalk is visual representation of processing done on the messages. In order to apply/design processing on the messages, Orchestration designer is used. Orchestration designer is accompanied with ToolBox which has various shapes catering some or the other functionality. So depending upon the functionality required for processing the message, shapes are dragged and dropped over the design surface.

As can be seen in below image, shapes like Receive shape for receiving message to start the process, Parallel shape for performing two sets of actions parallely and Send shape to send out messages are used.


So how does this shape implement their functionality? There has to be some code in background right?

Orchestration is a way to automate business processes which is nothing but an executable code to run a workflow supporting a business process.

Orchestrations(XLANG/s files) are compiled into .Net assembly, so apart from graphical representation there is two other form of Orchestration in its lifetime.

To view X# , right click on the orchestration in solution explorer-->select open with  and below window should appear


Except for Binary Editor (content will be in binary), Resource Editor (File is not opened - does not support) and BizTalk Orchestration Designer (Which opens the visual representation) rest of the editor will show the XML representation.

And to view in orchestration in C#, traverse to the project/solution folder and look into obj\Debug\BizTalk\Xlang folder and File0.cs should be there.
Double click and you should be able to see the code behind the orchestration which we design using various shape..

[Drive]\[Project/Solution folder]\obj\Debug\BizTalk\XLang



Although this is not required for designing orchestrations, it is good to know it (what's going in background)  .... ;)


Tuesday, February 4, 2014

Bronze Medal: TechNet Guru Awards - December 2013

Sunday, January 26, 2014

Is it possible to have Map Chaining on the Port Level

Firstly, let's understand what is Map chaining: The process of producing multiple documents from a single document by executing several maps to translate the single document.

So is it possible on the port level?

This has two answers, Yes and No depending upon how and where it is applied. 

To find out the working, I created a project with three document schema (Item, Product and Article) and a couple of maps and deployed it:

1. Map1: ItemToProduct
2. Map2: ProductToArticle

Scenario 1: Map chaining on a single port (Receive/Send Port)

In order to test map chaining on a single port, I configured ReceivePort with two maps as shown below and a send port configured to receive Article message.







After dropping the message at the receive location, the message was suspended. To check the what processing was done on the message before suspending, clicked on the Message Flow and it was clear that the ItemToProduct map was applied and the message was submitted to MessageBox. 






The second map was not applied, and this is because there is a 1:1 relation between the message and map. So after that one map is executed, EPM (End point manager) hands over the message to MessageAgent which takes over the later processing part of submitting the message to message box and querying for subscription. If no subscription found, it suspends the message.


So Map chaining is not possible on a single port.

Scenario 2: Map chaining on combination of Receive and Send Port

In order to test map chaining using combination of Receive Port and Send Port, I configured ReceivePort with the first map and a send port with the second map as shown below.








After dropping the Item message at receive location, article message was created at the destination. Both the maps were applied. 


So it is possible to achieve map chaining this way, but in between the intermediate message has to pass through MessageBox.

Can We Have Multiple Maps With Same Source Schema On The Port

Is it possible to have more than one map with same source schema on a port? There are two answers for it Yes and No.

Why Yes -- BizTalk won't stop you from configuring multiple maps with the same source. As it's perfectly legitimate to have a port associated with multiple maps.

Why No -- Irrespective of how many maps you have configured on the port, only the map which matches the MessageType of the message will be executed. And as soon as the first matching map is found, other maps are neglected. As the relation between message and map is 1:1, a message can be processed by a single map only (If and only if it's source type matches).

Let's consider this through a scenario:

We have three maps created with the same source schema, but different destination schema as shown below:


To test we deploy the application, and configure the receive port with all the three maps, as shown below:


An Item message was dropped in the receive location and the output was Artifact message, only one map was executed by the runtime.
That happens to be the first map from below, so does that mean runtime looks for map from bottom to up sequence?

To clarify this, I removed ItemToArtifact map, and tested again by dropping an Item message at receive location. And this time output was Product message. So the order in which the map gets selected can't be predicted.

But only one map is selected against a message in spite of having many maps with same source schema.

Wednesday, January 1, 2014

An activatable receive must be the first executable statement in a service

Whenever we add the Orchestration to a project, the first thing which is done almost every time is to add Receive shape as the first shape.  That’s because we need to apply some process when some particular piece of info (message) is obtained. Thus initiating the process designed in the orchestration.

Well this raised a question, can’t other shapes be used as the first shape in Orchestration?
To find out, I added a loop shape as a first shape with a Receive shape within it. Logically it seemed correct as I want to receive messages until the loop condition is satisfied.



When clicked on build following error appeared




With all said it’s obvious to think that  the first shape has to be Receive Shape . Well there are exceptions, shapes  like Group shape, Scope Shape, Listen Shape, Parallel shape  and orchestrations configured with parameters to enable invocation from other orchestration.



Will keep sharing as and when find something!!!!! Happy New year to all !!!!!!!

Tuesday, December 24, 2013

Converting Image File to Binary

There was required in one of project couple of months ago, wherein the image files have to be stored/inserted into the database using BizTalk.

Although we know that keeping files on folder location is much better than storing it in Database, we had to implement.

Note: BLOBs(Image files, Video files etc) smaller than 256KB are more efficiently handled by a database,while a filesystem is more efficient for those greater than 1MB. Of course, this will vary between different databases and filesystems.


It seemed to be challenging at the beginning, but was an interesting experience for me and my colleague  Dhiraj Bhavsar.

To achieve this, we came up with a solution of creating a Helper class which will convert the file into binary and later can be used .

Below is a screenshot  of Helper Class, which accepts a file path as input and returns data in bytes and deletes the file.





Note: This can used for other types of files also. 

Download Helper Class CodeFileReader - Helper Class to convert file into Bytes

Have composed an article as to how to insert images in SQL, have a look : BizTalk Server 2010: How to Insert Image In SQL Through Orchestration

Download BizTalk Server 2010: How to Insert Image In SQL Through Orchestration Sample