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.

converting image file to binary

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 

Friday, December 20, 2013

Beginner To Expert: BizTalk Available Resources

Yesterday received a mail from a beginner in BizTalk asking about how to learn BizTalk . What are the resources which are available and can help the learning process.

There is a huge amount of resources available in the form of  Books, Videos, Tutorials , Blogs , Articles , Samples etc.  You can begin learning and if you are stuck somewhere or do not understand some concept, there are dedicated BizTalk forums wherein you can ask questions and I can guarantee that your question will be answered.

So if you are truly passionate about learning BizTalk then do utilize the available resources, and in case you are comfortable learning from some tutor then I guess there are online training providers which you can look at.
I personally feel that at last it will be your curiosity of knowing more and more about BizTalk which will help you. (It applies to learning other technologies as well)

Below are a few links which I would like to suggest to look at (Beginners should):

Microsoft BizTalk Server

BizTalk Server Tutorials

BizTalk Server 2010 Developer Training Kit

Microsoft BizTalk Server 2010 Help

How about seeing the samples and understanding how the implementations are done: BizTalk Server Code Gallery Samples

The most important resource which I feel personally is  BizTalk Server Resources on the TechNet Wiki (This is certainly a gateway to BizTalk World), it holds excellent articles written by MVP's, MCC's and BizTalk Community member from all over the world. It does contains lot of other links and resources which will help you in learning as well when you are working on some project.

Likewise there are many Community members who share their experiences via their blog, you can look out for those too.

Experts are the people who know how to implement the concept they know, so keep implementing. It will take time as BizTalk deals with many technologies and is very rich from that perspective.

So Keep BizTalking !!!!!!!!

Update: BizTalk Featured Downloads from Microsoft

Tuesday, December 17, 2013

Token StartElement in state Epilog would result in an invalid XML document.

In a project there was requirement to aggregate the responses, and for that I used SendPipeline in Orchestration.

Created a Envelope schema, imported the document schema and set the Body Xpath.

All was smooth, even the messages were consumed until the last one and following error appeared in the EventLog.

token startelement in state epilog

What was this about, tried many things but still haven't found the reason why this happened.

Finally thought of having look at the Aggregator Sample, all was almost same except one thing.

In the sample the Envelope schema has used <Any> element, so I did the same ( though I was not in harmony to use it) but it worked.

<Any> means to allow the elements which are not specified in schema, then why not elements specified in schema.

So now the question is , is this exceptional case or is there something else which should be considered?

Will try to dig more into it .... and will update with the finding!!!!!!!!!!