Ryan Mick posted on December 15, 2008 16:03

Background:
I work for a community bank and like a lot of community banks we out source the hosting of our banking system or core as it is referred to. Our core is a product by Fiserv called CBS that is running on an AS400.
The Problem:
Recently I was given the task of writing an application to pull data from our core and then update records in the core based on the data we pulled. The problem was that no direct query can be made against the core. To accomplish this I would have to use an application that Fiserv produces called Communicator.
Communicator is a web application using ASP.Net and some XML posting using a subset of the IFX communication specification. Basically you create an XML doc based on the specs and post it to the communicator web page. The XML is converted into a query and ran against the core and the results are converted into XML and sent back in the response stream. The problem with communicator is that the documentation is not very good and contradicts it’s self in many places. Also you are not provided with any XML templates to use, instead you are given a dizzying 500+ XSD files to validate you queries with. I can’t say that I much like having to write code to post to a web page as this could have easily been a web service but I am not on the development team at Fiserv.
First Steps:
Being a .Net developer I wanted my solution to use objects that I could easily manage and so I started the task of writing a parser to open up the XSD files and then try to create objects from them. After several days of writing exception code because the structures of the XSD’s were inconsistent. I decided to look around and see if a program already existed to accomplish this. I do not like reinventing the wheel. I found a few applications and tried them out but the resulting code seemed too bulky to me so I kept looking.
Then out of the blue I find a reference to
LINQ to XSD, what? This is still being developed by Microsoft but a download was available and so I decided to give it a try. Sure enough, it created the objects with all the LINQ goodness you could ask for. The generated classes are also partial classes so that just opens the door to even more goodness. The only problem is how it compiles the objects. You add the XSD’s to your project and then set the build action to a special entry that is created when you install LINQ to XSD. This then uses a special build operation that passes the name of each file to the compiler. Too many files and the compiler crashes. Since the XSD’s were already broken into groups the solution was to break up the groups into multiple projects. A couple of groups were still too big and had to be broken up into multiple projects to get everything compiled. Once the larger groups were compiled I used ILMerge to create a single assembly.