1

I have a scenario, my asp.net application is consuming a WCF service. Now for the service has two version say for example testservice and prodservice. I have to use either of them at any given time. In order to test, I need to point my appplication to test or prod. Can I achieve this by, simply changing url in endpoint in web.config of my asp.net application or need to add saperate service refernce for each of them.

Please guide.

Thaks

Manish
  • 37
  • 3

1 Answers1

0

I suppose it should work if you change the endpoint's address in the web.config file, however, you must change it each time you want to switch the service used.

If you want to switch the endpoints during development, I suppose that you can define multiple, configuration dependent web.config files and define different endpoint addresses there. This way you can only switch build configuration when compiling the application and it'll use the appropriate endpoint. For more information about it, see answer to this question for more information about it.

Community
  • 1
  • 1
Lukasz M
  • 5,635
  • 2
  • 22
  • 29
  • Yes this is for temporary purpose and will not be needed in future, So just wanted to confirm can we do it by simply changing the url, since rest of the things like binding contract are same – Manish Mar 24 '12 at 08:23
  • I suppose it would be best just to test it and see if it works. Make sure the address is not hardcoded anywhere in the application's source code. – Lukasz M Mar 24 '12 at 10:01