Web Services Namespace Dynamic Naming

I have a web-service that I will deploy for dev, intermediate build and production. Along with this, there will be an ASP.net application that will be deployed separately, but also in these three phases.

What is the most pragmatic way to change the next line in a web service to fit the current environment?

 [WebService(Namespace = "http://dev.mycompany.com/MyAppsWebService")] [WebService(Namespace = "http://stage.mycompany.com/MyAppsWebService")] [WebService(Namespace = "http://mycompany.com/MyAppsWebService")] 
+4
source share
1 answer

Your webservice object has a "URL" property that can be set via the web.config file. A configuration file is created there, which is created by adding a web link to your application in order to copy the contents to the web.config or app.config file. You can then deploy the configuration file and not control any code changes to post the change to the URL.

+2
source

Source: https://habr.com/ru/post/1276512/


All Articles