简体   繁体   中英

List of Web Services in ASP.Net

My application needs to calls a number of web services that I have running on different machines. The web services are the same, but there are multiple machines that provide the web service.

My question is how to maintain a list of the web services so the user can pick which machine to run on? I've imported the web services to create the wsdl and discomap files, and in the web.config there is

<appSettings>
  <add key="MBAnalyzerWSRef.MBAnalyzerWS_intf" value="http://127.0.0.1:1235/services/MBAnalyzerWS"/>
</appSettings>

I can add add additional keys all for the different machines that provide the service, but how to treat them as the same service, add them to an array and use them in c# code? Something like this is the goal:

wsList List<MBAnalyzerWSRef> = new List<MBAnalyzerWSRef>;
/* Add the services to the list */
wsList[0].DoWebServiceTask;

I hope I've made the question clear. TIA

Does MBAnalyzerWSRef have a URL property? as in MBAnalyzerWSRef.Url = ValueFromInput.

Surely you can solve the way users can pick a value from a list of preset addresses. So it should be easy to set the URL property?

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