开发者

.NET Conditional Web Services

开发者 https://www.devze.com 2022-12-20 09:55 出处:网络
My C# application has three testing stages: alpha, staging and production. Each stage for my application has a sibling web service. The APIs for all three web services are the same.

My C# application has three testing stages: alpha, staging and production. Each stage for my application has a sibling web service. The APIs for all three web services are the same.

How could my application use the appropriate sibling web service based solely on alterations to the web.config 开发者_Python百科file?

The goal being to have very little duplicate code, and for the source for my application to be the same across all stages.


If you use WCF, the endpoint can easily be defined entirely in the config file.


quick case for xml web services: define some appsettings and whenever you new a proxy, use the appsetting as the constructor arg.

but steven has a better suggestion for you, use WCF if you can.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号