We are developing an Intranet Web Application that consumes about 7 to 8 internal web services [.NET and J2EE] for different transactions. We host the web services and our application in different environments viz DEV, Test, UAT etc.
The web references for these web services are set to Dynamic and Web Services URL is dynamically taken from the Web.config file. Now we want to have a standard web.config file in order to keep our deployment to any of the environment the same. When we are in DEV environment we need to access the Web Services that were hosted in DEV and vice versa for other environments. The problem now is we cannot have a common Web.config file that has the URL for the web services, that is being used by our web reference. Because when we move the code from DEV to Test to UAT etc, we need to make changes to web.config file. The pain is there are 4 to 5 servers involved in Test and UAT environments and we have to manually edit the web.config file in all the servers to point to specific web services URL. If the web application and web services are hosted on the same servers, Is there any way to dynamically configure the URL for web services in web.config?
For e.g,
In Test environment we have 5 servers (test01.myserver.net, test02.myserver.net, test03.myserver.net, etc) both the web application and web services are hosted on the same servers. The web application in test01.myserver.net has to access the web service hosted in test01.myserver.net and vice versa for other servers. In this case I need to manually edit the web.config in all the 5 servers and change the Web Services URL of the 7 services to point the respective URL.
We are not allowed to keep the web services in a single server, In test environment both the web application and web services has to exist in the same server. But these servers are load balanced.
Is there any way to dynamically configure the web.config file? Like using host files or environment variable..
It would be great if anyone throw me some light to resolve this.
Thanks!