在ASP.Net Web服务的列表 [英] List of Web Services in ASP.Net

查看:115
本文介绍了在ASP.Net Web服务的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序需要调用一些,我已经在不同的机器上运行的Web服务。 Web服务是相同的,但也有提供网络服务的多个机器。

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.

我的问题是如何保持的Web服务的列表,以便用户可以选择运行哪台机器上?我已经导入Web服务创建WSDL和discomap文件,并在web.config中有

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>

我可以添加添加其他密钥都为提供服务的不同机器,但如何将它们视为相同的服务,将它们添加到一个数组,在C#code使用它们?这样的事情是我们的目标:

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;

我希望我做了明确的问题。 TIA

I hope I've made the question clear. TIA

推荐答案

是否MBAnalyzerWSRef有一个URL属性?在MBAnalyzerWSRef.Url = ValueFromInput。

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

当然,你可以解决用户的方式可以从preset的地址的列表中选择一个值。因此,它应该很容易设置URL属性?

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?

这篇关于在ASP.Net Web服务的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆