Generic web service creator using generics and delegates
November 9, 2006
This post now contains an update https://www.marcusoft.net/2006/11/more-about-generic-webservces.html. Be sure to look it up for a more elegant solution
Yesterday was spent with my nose deep down the documentation of .NET 2.0, pondering poses and head scratching.
But the reward was a quite cool little hack that solved a tricky problem in our solution.
In my current project we’re are using some web services and these all need to be configured in the same way. These configurations has to do with setting the URL in runtime, using other credentials, caching and maybe other things that we want to be able to do for all web services.
So what I wanted is a WebServiceCreator with methods that creates the web services and does the requested configurations. So my first thought was to use generics - and that was right for quite a while.
I created a class WebServiceCreator that has one...