开发者

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, bu开发者_如何学Pythont 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?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜