Martijn's blog - E-Commerce, EAI, BizTalk and .NET

2005/04/28

Untyped Message Processing and external projects

Have you ever used untyped messages send to a general Orchestration (error handling, general processing, etc)?

If you have, you've probably casted the outbound message into a variable of type System.Xml.XmlDocument and passed that to the called or started Orchestration...

However, if you factor out the general orchestration to enable reuse from other projects, you are no longer able to do this.

Instead, BizTalk wraps your Orchestration parameter into a type called Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy, which enables serialization of type System.Xml.XmlDocument, as it's missing the Serializable attribute. It does this outbound only, so you need to perform a few steps to get your Orchestration call back online:

1) reference Microsoft.XLANGs.RuntimeTypes.dll from the Microsoft BizTalk Server 2004 installation folder into both projects;

2) change your general Orchestration (the one factored out) to have a your Orchestration parameter as type Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy instead of System.Xml.XmlDocument (otherwise, the types won't match and VS.NET won't let you compile ;-) );

3) change your calling Orchestration to have a variable of type Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy instead of System.Xml.XmlDocument and set your Expression shape to do this:

GeneralConfirmation = new Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy(ConfirmAccount);

3) compile the external referenced project;

4) reconfigure your Call Orchestration or Start Orchestration shape.

Now your Orchestration will function correctly, just like before. The difference being able to reuse the general Orchestration originally contained within the same project.

4 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home