How can I dynamically switch web service addresses in .NET without a recompile?

后端 未结 11 954
小蘑菇
小蘑菇 2020-11-28 09:11

I have code that references a web service, and I\'d like the address of that web service to be dynamic (read from a database, config file, etc.) so that it is easily changed

11条回答
  •  攒了一身酷
    2020-11-28 09:52

    For me a Reference to a WebService is a

    SERVICE REFERENCE

    .

    Anyway it's very easy. As someone said, you just have to change the URL in the web.config file.

    
        
          
            
          
        
        
            **** CHANGE THE LINE BELOW TO CHANGE THE URL **** 
            
        
    

提交回复
热议问题