开发者

consuming multiple clients of the same C# webservice from different remote locations

I'm working on two webservices

Call the first one ModelService

and the second one ConfigurationService

My goal is to have multiple servers running the ConfigurationService and one central server running the ModelService

So far what I have working is the ModelService has a ServiceReference added which points to http://localhost:4958/ConfigurationService.svc

And I access it as:

ConfigurationService.ConfigurationServiceClient svc = new ConfigurationService.ConfigurationServiceClient();
ConfigurationService.WrappedConfiguration config = svc.GetConfiguration();

I know there are constructors that use things like string endpointConfigurationName, string remoteAddess which I'm guessing are how I will point to instances of the ConfigurationService 开发者_StackOverflowon different servers.

What I can't get to work/don't understand, is what do I add as a service reference to ModelService in order for it to be able to create ConfigurationService objects for each of the remote servers.

And how do I configure a ConfigurationService on a server to know what it's endpoint is?


You can add service reference from any of your servers running ConfigurationService. The important part is that you have to keep list of those servers (URLs) somewhere in ModelService to be able to create client to any of "configuration servers". The mentioned constructor will allow you to do that.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜