Share via


Building Web Services the Easy Way

Regular Readers will know that I prefer to avoid writing boring code if at all possible, and use CodeSmith when I can to achieve this aim by generating a lot of the dull code for me.

For Web Services, there is now an even simpler way to avoid writing any code to build them, and this is via the completed Service Factory, posted to MSDN yesterday.

Now of course it's not that hard to create a Web Service in Visual Studio right now, so you're probably asking - what's the big deal?

Well, this Factory is intended to be end-to-end, in that it will create not only the web service (in ASMX or using WCF), but the CRUD stored procs, the data layer, an entity layer, mapping between the two, and a Client winforms application to call the Web Service with. This is much more than you can do with templates and CodeSmith today, as there is a number of wizard-like UI interfaces that gather information needed to complete the code generation. There is a similar mechanism in CodeSmith of course but not with this level of sophistication, in part because there are a number of linked steps to creating the code, some of which depend on you picking code just generated. You would have to do this as separate steps in CodeSmith, manually loading and starting a different template each time, one after another. With the Service Factory, which uses the same concept (called "Recipes"), these are just linked together and data is fed along the chain.

You could just grab the bits and start playing but let me recommend you first invest in some time watching this excellent webcast by Don Smith, which is short on PowerPoint and long on demonstration. It's an action-packed hour and he shows using this Factory to create a complete end-to-end solution (the source code he made and database he used he subsequently made available.)

I think this is a very compelling way to write software and if you are unaware of the possibilities it's time to check this out - there is a great deal of time to be saved!