Ejemplo n.º 1
0
        protected Binding CreateEventServiceBinding(string address)
        {
            IChannelController[] controllers;
            // add mandatory controllers.
            // _trafficListener is used to monitor data sent and received via Client.
            // _semaphore is used to stop waiting for the answer.

            EndpointController controller = new EndpointController(new EndpointAddress(address));

            WsaController wsaController = new WsaController();

            controllers = new IChannelController[]
            {
                _trafficListener,
                _semaphore,
                _credentialsProvider,
                controller,
                wsaController,
                new SoapValidator(EventsSchemasSet.GetInstance())
            };

            Binding binding = CreateBinding(controllers);

            return(binding);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets instance (if instance has not been created - creates it).
        /// </summary>
        /// <returns>EventsSchemasSet</returns>
        public static EventsSchemasSet GetInstance()
        {
            if (_instance == null)
            {
                _instance = new EventsSchemasSet();
            }

            return(_instance);
        }
Ejemplo n.º 3
0
        public static ServiceHolder <EventPortTypeClient, EventPortType> DefaultInitializer(this IEventService s)
        {
            var deviceService = s as IDeviceService;

            if (null == deviceService)
            {
                s.Test.Assert(false, "The test doesn't implement Device Service", "Implementation issue");
            }

            var client = new ServiceHolder <EventPortTypeClient, EventPortType>(features => deviceService.GetEventServiceAddress(),
                                                                                (binding, address) => new EventPortTypeClient(binding, address),
                                                                                "Event");

            if (null == client.Client)
            {
                client.InitServiceClient(new IChannelController[] { new SoapValidator(EventsSchemasSet.GetInstance()) }, s.Test);
            }

            return(client);
        }
Ejemplo n.º 4
0
        private HttpBinding CreateEventServiceBinding(string address)
        {
            IChannelController[] controllers;
            // add mandatory controllers.
            // _trafficListener is used to monitor data sent and received via Client.
            // _semaphore is used to stop waiting for the answer.

            EndpointController controller = new EndpointController(new EndpointAddress(address));

            controller.WsaEnabled = true;
            controllers           = new IChannelController[] { _trafficListener, _semaphore, controller, new SoapValidator(EventsSchemasSet.GetInstance()) };

            HttpBinding binding = new HttpBinding(controllers);

            return(binding);
        }