简体   繁体   中英

Adding multiple service reference to one C# project

i have one c# project and database which is running on multiple branches separately, one of these branches is the main one and i call it the center , i want to send data from the center to other branches using web service , so there are equal web services running on each branch and i added all of them as service references to my center project manually , but when i want to add a new branch i have to add another service reference to my project manually again , is it possible to add different endpoint (branched ip addresses) dynamically to my project? or all in all any other ideas to how i can manage sending and receiving data between center and branches? Thanks

If you want to dynamically add endpoints, you can programmatically include connect. You can read the connection data from your database and then add the endpoint with the ChannelFactory class. You can find an example here:

How to programmatically connect a client to a WCF service?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM