C# - Web Services in N-Tier Systems

Soldato
Joined
5 Mar 2003
Posts
10,771
Location
Nottingham
Ahoy,
Bit of confusion over this one, as I *must* be doing something wrong. We have a number of internal and external websites, with some common functionality (one of which is a post code look up control). So I thought right, I will make a common control that calls a method in the framework that does all the postcode relation functionality. So I put the web service in that solution and bang.... doesnt work.

The only way to get it to work is put the service bindings in all the web config files of the sites that use this. Now I have nothing against config files, but I only want to edit it in one place. Is there a way I can have the app.config file of the framework solution have the bindings in rather than all the applications?
Cheers!
 
Last edited:
I don't *think* that app.config files are compiled as part of class libraries, so no I'd guess you need to add the relevant client config sections to each app/web.config. However, if you're using a WCF service you could hardcode the binding information inside the library. Not very flexible, but it means you only need to change it in the one place. It's pretty straightforward though.
 
Back
Top Bottom