Question

I am planning to start a POC for MS CRM and BizTalk 2010 Integration.

Before that I wanted to know does any body use BizTalk 2010 for integration with MS CRM?

Was it helpful?

Solution

We're using BizTalk 2010 to call into Microsoft Dynamics CRM 2011 Organization service.

There are basically two ways to do this, but I'm committed to find others.

The first way is to use the BizTalk schemas that ship with the SDK along with an external C# based class library helper. This scenario is pretty tell covered on the internet. Note that this scenario will not allow BizTalk to call into the CRM early-bound classes (Account, etc.) It will only allow using the generic CrmEntity object which makes dealing with the mapping a painful experience.

The external helper is necessary to deal with the LiveID federation idiosyncrasies.

This first method has the advantage of being simple. But you cannot use native CRM types from BizTalk.

The second way is to somehow solve the above problems, at least partly. First, it involves building a WCF façade that exposes native early-bound CRM objects (such as Account, etc.) and that deals with LiveID federation.

As generated, the early-bound classes are not serializable so they can't be part of a WCF interface (and service). This can be solved by decorating each and every properties with a DataContractAttribute. Also, read-only properties need to have an extra empty set {} added to them. Please, note that there are a huge number of such (simple) changes to make in the generated classes. Fortunately, as a generated file, the syntax is consistent and a couple of simple RegEx's will do.

On the BizTalk side, you will consume the WCF façade metadata in order to generate BizTalk schemas. Unfortunately, you will end up with huge multi-megabyte files and cross-dependend schemas.

So, first, you have to break the circular dependencies. In my case, I had to add an extra schema to hold shared complex types that were used by both the "contract" and the "metadata" schémas.

Next, you cannot easily use the huge generated schemas in your maps. First opening the map (or the schema alone) will take ages. Second, the compiler will choke and Visual Studio will crash.

To solve this, you need to manually change the GenerateDefaultFixedNodes attribute in your map's .btm XML file.

What I recommend, however, is to use a simplified version of the generated schemas, where you only include nodes and structures that are part of the mapping. Since most nodes are optional, the resulting XML request to the WCF façade will end up being the same.

The advantage of this second method is to be able to deal with native CRM types from BizTalk. But the implementation might sound complicated at first. With proper automation, in practice it works pretty well, even in the face of changes on the CRM side.

None of the methods, however, feel as "native" BizTalk integration. That's why I'm working on finding an alternate way, perhaps by building a dedicated custom binding, but so far without success.

See my question here.

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top