Saturday, July 18, 2015

When was BizTalk Application Last Modified

Few days ago, there was a situation where we had to confirm that the BizTalk application running in production env is the latest, i.e. against the latest checked in on TFS.

At first it was quite natural to check the admin console to find out the last modified date and time of the assembly, so checked the Resources section of the application of interest.


That was not helpful, as can be seen in above image because only five information are displayed Name, Type ,Source Location , Destination Location and Application. There was no information about last updated time.

So how to find when was assembly last modified? 

Whenever you deploy BizTalk application/assemblies, entries are made in two places BizTalkMgtDb(BizTalk Management Database) and GAC(Global assembly cache).

But GAC too, does not have any info about when assembly was added - as can be seen in below image.

BizTalk management database contains all artifacts that are part of a BizTalk solution - Schemas, Maps, Orchestrations,Ports. Assemblies and applications also go into this database. Thus here you get all the information, below are steps to find last updated date of an an application.

1. Login to SQL Management Studio
2. Databases--> BizTalkMgmtDb--> Tables

3. Select dbo.bts_application table --> right click --> Select Top 1000 rows (you can even query against this table -- select * from dbo.bts_application)

An application can comprise of one or more assemblies, so to check about assemblies query dbo.bts_assembly

Actually the Admin console fetches information from this table and displays it, but only five and not all, that's how it is being designed (In my opinion Microsoft should consider including one more column in Admin console for Updated date and time).

If you wish to go for more granular details like when the specific schema/map/orchestration was last updated then you can check following tables

1. dbo.bt_DocumentSpec      

2. dbo.bt_MapSpec 

3. dbo.bts_orchestration      

Note: The modified date does change after every restart of that particular Orchestration.


Wednesday, July 8, 2015

There is an error in the XML document : InvalidOperationException

In current application I have requirement to choose the flow based on a field's value. As it can't be distinguished I used Xpath. It's simple, to fetch value following is what needs to be done:

var = xpath(messageOnWhichXpathIstoBeapplied, "xpathQuery");
I did same, but got following error:
xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'Palette.E1.CreateInvoiceE1(0b616f5a-048d-e8d5-b014-91cde67160f9)'.

The service instance will remain suspended until administratively resumed or terminated.

If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.

InstanceId: ba30a5f2-c173-4eff-8d31-e1cb9dc8c3b3

Shape name: Get_Status

ShapeId: 7b7bd44c-bf3f-4cd8-ba61-232c818d8271

Exception thrown from: segment 1, progress 6

Inner exception: There is an error in the XML document.

Exception type: InvalidOperationException

Source: System.Xml

Target Site: System.Object Deserialize(System.Xml.XmlReader, System.String, System.Xml.Serialization.XmlDeserializationEvents)

The following is a stack trace that identifies the location where the exception occured

at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)

at Microsoft.XLANGs.Core.Part.XPathLoad(Part sourcePart, String xpath, Type dstType)

at Palette.E1.CreateInvoiceE1.segment1(StopConditions stopOn)

at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)

Additional error information:

<Status xmlns=''> was not expected.

Exception type: InvalidOperationException

Source: System.Xml

Target Site: System.Object Read_int()

The following is a stack trace that identifies the location where the exception occured

at System.Xml.Serialization.XmlSerializationPrimitiveReader.Read_int()

at System.Xml.Serialization.XmlSerializer.DeserializePrimitive(XmlReader xmlReader, XmlDeserializationEvents events)

at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)


Why it Happened

As can be seen in image below, I am trying to assign value of Status field to varStatus variable(of type Int32), looks correct but this is not. Xpath is used to select nodes or node sets from an Xml document, thus if I am using xmlVariable to get the value from below xpath query it would have been correct. Xpath queries do not implicitly do type conversion, thus the error.

What to Do

In order to fetch values other than XML, you need to explicitly specify the Xpath about the type conversion and for that we need to use xpath functions depending upon requirement.
For Number it is number(xpathquery), for String value it is string(xpathquery) , for Boolean value it is boolen(xpathquery) etc.
Thus to get rid of error, I used number xpath function to fetch value from status field, and assigned to varStatus variable of type Int32.

Wednesday, July 1, 2015

Begineer to BizTalk Expert : Interview with Mohamad Halabi

Welcome to thirteenth interview of the series, today's expert is Mohamad Halabi.

He is six time MVP award receiver and  work as a Solution Architect in the e-Government secto and his main responsibilities are:
-Designing an Enterprise Service bus using BizTalk Server, WCF, WF, ADFS, and WIF
-Designing and automating the enterprise Application lifecycle management through TFS
-Managing IT Governance through COBIT and ITIL

He is also a speaker in Microsoft events such as GDC, TechEd ME, and Open Door and member of Devlifestyle Microsoft User Group.

Let's begin the interview....

Mahesh: Who are you and what you do?
I am Mohamad Halabi, a Microsoft Integration MVP. I am from Lebanon. I work as a Chief Architect in the government sector. My work revolves around Enterprise Architecture - from Business Architecture to IT architecture. It might seem that my work is more at a higher level than implementation, but I'm a firm believer than an (practical) architect should guide projects from architectural design all the way to implementation and technology, and that's what I do.

Mahesh: When did you start working on BizTalk?
I started with BizTalk Server back in 2006. It was a self learning journey driven by big interest in integration. I knew back then that integration was the path I want to take. After I learned BizTalk, I was lucky that my company - who till then was mainly working on web technologies - got it's first BizTalk project. I immediately took the chance and asked to be handed the project. I got my wish and I started from there.

Mahesh: How did you mastered BizTalk (Learning path, amount of time)?
As I said, it started as a self learning journey. I purchased a book, read it, and started a project. Of course as you know, studying BizTalk and actually implementing it are two totally different things. I starting learning as I implemented - and still do till this very day. It's hard to specify a time, because as I said, I still learn every day - but that's the fun part!

Mahesh: Which are the major projects you handled so far?
I'd say the major projects (12 months +) are 4 mainly in the retail and government sectors. There are other smaller to medium projects ranging from a couple of process to re-engineering existing implementations.

Mahesh: How do you see BizTalk compare to other integration platform?
Well I have not used other integration platforms although I've seen the latest IBM Integration Bus (IIB) in action. Therefore I cannot do an objective comparison, but I have to say that BizTalk has always served me well in all scenarios. BizTalk - with the ESB toolkit - has covered every need whenever the scenario calls for the ESB architectural style.

Mahesh: What as per you is must to know to become an Integration(BizTalk) Expert?
I think this is a very important question, because I've met many people who think they would be integration experts just by learning the tool - which I believe is incorrect. As an integration architect you are required to know a lot of standards, protocols, and technologies. For example HTTP, XML, XPath, WS-*, REST, WCF, MEPs (just to name few) are just some of the things an integration architect must know. Learning BizTalk architecture is of course essential, but mastering the tool alone is not enough: after all BizTalk is intended to be a middleware 'sitting' in the middle of different platforms, protocols, and styles; if you do not know how these things work, then knowing the tool alone won't help much.

Mahesh: What are your thoughts on forums,blogs and articles etc.?
The wealth of existing online resources is a great asset for any aspiring BizTalk developer/administrator. I think that BizTalk has such a rich online community that it rarely happens that a problem has no solution posted somewhere.

Mahesh: Your suggestion to a newcomers? What should be approach to get sound knowledge in Biztalk?
Well why not start with a little bit of marketing for myself :) I'd tell them go check my Pluralsight BizTalk course. Of course there are a lot of great books about BizTalk - all are great learning resources. But I repeat what I said before: the learning path should cover a large scope of technologies, protocols, standards, addition to BizTalk as a tool.

Mahesh: There are many tools from community which support BizTalk in some or the other way(like BTDF, Bizunit etc), what do you say about it? Which ones you would recommend?Why?
I've used various tools along the way, such as the BizTalk Deployment Framework, BizTalk Terminator, and BizTalk MsgBox Viewer. In general I always keep an eye on the community for what it's producing and I advise every BizTalk dev/admin to do the same. Reusability is critical, and if someone has put time and effort to serve the community, others must take advantage.

Mahesh: What are your thoughts around BizTalk certification?
They're nice to have :) but as someone who interviews people regularly, frankly certifications are not an indication for knowledge anymore. For various reasons it became easy to gain certifications. In addition, in my opinion the team behind certifications at Microsoft must work to make the exam questions more like real-world scenarios, because right now they are not.

Mahesh: What is the future of BizTalk?
Well with Microsoft recently ending support for Windows Server AppFabric - which for a while looked like BizTalk's alternative (regardless whether that was actually their plan) - it seems BizTalk is here to stay for on-premise integration. That being said, the future path is cloud-based, but do not expect enterprises with millions of dollars worth of investment to just dump everything and move on. On-premise integrations will continue and with them - I believe - BizTalk will continue to be strong. Meanwhile, Azure BizTalk Services is there to help with hybrid (on-premise / cloud) applications which will allow organizations to gradually switch to the cloud. That being said, BizTalk Services is still in its early stages and surely Microsoft will invest more on it.

Mahesh: Any thoughts on cloud?
It's clear that the cloud is major shift. It's the perfect example of how technology provides opportunists to business. The advantages are there for everyone to see; however, as I said, the movement takes time and existing on-premise investments will continue to function. In addition many government agencies will not move easily - if they ever do.

Mahesh: What motivates you to do the community work?
Networking! In my career I probably learned from people more than I did from books. There is no better way to connect with people of different expertise and backgrounds than the community.

Mahesh: Being MVP, do you feel that responsibilities get added? What is your thought on MVP?
Well I don't see the MVP award as a responsibility, but rather as an appreciation that I must live up to. I frankly never worked to be an MVP, but when I was rewarded I cannot hide the fact that I was very proud to be part of this community. Besides all the technical benefits, the MVP community is the perfect place to connect with people of different backgrounds and expertise - which as I said before, is the main reason I do community work at the first place.
Thanks a lot Mohamad for sharing your experiences, this will surely benefit many !!!

Feel Free to ask questions to Mohamad in the comments!!!!!!!!

Related Post: