BizTalk: Exposing .NET Classes

posted on 2005-06-14 at 01:11:49 by Joel Ross

Ok. I'm new to BizTalk Server, but I think I got this right. Please let me know if I didn't.

I have an existing application that uses an object. I want to take this object, allow BizTalk to accept messages of that type, and map them to another message type that can then be sent out to a third party verification system. Sounds like a pretty typical scenario to me.

It took me a while to figure it out though. First, I added a reference in BizTalk to my business object class. Then I created ports that could receive a .NET object of my type. That worked - I could even set up a web service based on that object. Then I got to the mapper. No schema was defined my custom object, and I couldn't find an easy way to get one.

Searching Google didn't help either - do a search for "create schema from c# class", and you'll be flooded with results for "create c# class from schema" - no one is doing it backwards. Of course, the solution is pretty simple. You can run xsd.exe on a class and tell it what type you want the xsd for. We ran into a few issues, but nothing major, and now I have an XSD file for my type.

Once you get that, you can then generate everything I did above - a message for it, a web service for it, and, now that I have schema, I can do mapping.

I know this probably isn't the most ideal way to use BizTalk, but it works for us for now.

Categories: Development