简体   繁体   English

ASP.Net中的Web服务列表

[英]List of Web Services in ASP.Net

My application needs to calls a number of web services that I have running on different machines. 我的应用程序需要调用在不同计算机上运行的许多Web服务。 The web services are the same, but there are multiple machines that provide the web service. Web服务是相同的,但是有多台机器提供Web服务。

My question is how to maintain a list of the web services so the user can pick which machine to run on? 我的问题是如何维护Web服务列表,以便用户可以选择要在哪台计算机上运行? I've imported the web services to create the wsdl and discomap files, and in the web.config there is 我已经导入了Web服务以创建wsdl和discomap文件,并且在web.config中有

<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? 我可以为提供服务的不同机器添加所有添加的附加键,但是如何将它们视为相同的服务,将它们添加到数组中并在c#代码中使用它们呢? 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 TIA

Does MBAnalyzerWSRef have a URL property? MBAnalyzerWSRef是否具有URL属性? as in MBAnalyzerWSRef.Url = ValueFromInput. 如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? 因此设置URL属性应该很容易?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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