开发者

WCF Configuration

I'm writing my first WCF Service and I need some help with my architecture. The AppPool consist of 7 services. (ConfigService, SwitchService, CameraService, TelescopeService, etc... ). The ConfigService returns an xElement that defines how the services should be used. Here is the example...

 <configuration>
   <configSet name="Configuration 1" Available="True">
     <serviceSet name="SwitchService">
       <Driver DriverId="ASCOM.Simulator.NWaySwitchDriver" ui="Standard"/>
     </serviceSet>
     <serviceSet name="CameraService">
       <Driver DriverId="ASCOM.Simulator.Camera" ui="Standard"/>
     </serviceSet>
   </configSet>
   <configSet name="Configuration 2" Available="True">
     <serviceSet name="SwitchService">
       <Driver DriverId="ASCOM.Simulator.NWaySwitchDriver" ui="Standard"/>
     </serviceSet>
   </configSet>
 </configuration>

The xml tells the consuming applicaiton that the server is setup for 2 configurations and which services and drivers are configured for thoes services. This also means that only 2开发者_StackOverflow社区 applicaitons can connect at a time, each one using a seperate configuration. If a third applicaiton is trying to connect it needs to be refused or told that the configurations are not available yet.

How can I manage the services so that only one consuming applicaiton can use one configuration that consisit of 1 or more services?


I think you are going to have to have your service "register" the consuming application, and pass it back a token. Subsequent calls should only work if the token matches. You will have to setup some kind of timeout to guard against the consuming service timing out.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜