static void Main(string[] args) { Subscriber sub = new Subscriber(); try { using (var proxy = new OMSTopologyServiceProxy("TopologyServiceEndpoint")) { var ui = proxy.GetOMSModel(); } using (var proxy = new OutageSimulatorServiceProxy(EndpointNames.OutageSimulatorServiceEndpoint)) { proxy.StopOutageSimulation(0x0000000c00000029); } } catch (Exception ex) { Console.WriteLine(ex.Message); } //ProxyFactory proxyFactory = new ProxyFactory(); //proxy = proxyFactory.CreatePRoxy<SubscriberProxy, ISubscriber>(new SCADASubscriber(), EndpointNames.SubscriberEndpoint); SubscriberProxy subProxy = new SubscriberProxy(sub, EndpointNames.SubscriberEndpoint); subProxy.Subscribe(Topic.OMS_MODEL); Console.ReadLine(); }
private void ImportTopologyModel() { using (OMSTopologyServiceProxy omsTopologyProxy = proxyFactory.CreateProxy <OMSTopologyServiceProxy, ITopologyOMSService>(EndpointNames.TopologyOMSServiceEndpoint)) { if (omsTopologyProxy == null) { string message = "From method ImportTopologyModel(): TopologyServiceProxy is null."; logger.LogError(message); throw new NullReferenceException(message); } TopologyModel = omsTopologyProxy.GetOMSModel(); } }