/// <summary> /// Initializes (and returns) event service address (using GetCapabilities method). /// </summary> /// <returns></returns> protected string GetEventServiceAddress() { string address = string.Empty; RunStep(() => { Binding binding = CreateBinding(true, new IChannelController[] { new SoapValidator(DeviceManagementSchemasSet.GetInstance()) }); DeviceClient device = new DeviceClient(binding, new EndpointAddress(_cameraAddress)); AddSecurityBehaviour(device.Endpoint); address = device.GetEventServiceAddress(Features); device.Close(); if (string.IsNullOrEmpty(address)) { throw new DutPropertiesException("Event capabilities not found"); } Uri uri; if (!Uri.TryCreate(address, UriKind.Absolute, out uri)) { throw new AssertException(string.Format("Event service address [{0}] is invalid", address)); } }, "Get Event service address"); DoRequestDelay(); _eventServiceAddress = address; return(address); }
/// <summary> /// Returns DUT's media service address /// </summary> /// <returns>Replay service url</returns> protected string GetReplayServiceAddress() { string address = string.Empty; RunStep(() => { Binding binding = CreateBinding(false, new IChannelController[] { new SoapValidator(DeviceManagementSchemasSet.GetInstance()) }); DeviceClient device = new DeviceClient(binding, new EndpointAddress(_cameraAddress)); AttachSecurity(device.Endpoint); SetupChannel(device.InnerChannel); address = device.GetReplayServiceAddress(Features); device.Close(); if (string.IsNullOrEmpty(address)) { throw new AssertException("The DUT did not return Replay service address"); } }, "Get Replay Service address"); DoRequestDelay(); return(address); }
protected override DeviceClient CreateClient() { Binding binding = CreateBinding(true, new IChannelController[] { new SoapValidator(DeviceManagementSchemasSet.GetInstance()) }); DeviceClient client = new DeviceClient(binding, new EndpointAddress(_cameraAddress)); return(client); }
/// <summary> /// Gets instance (if instance has not been created - creates it). /// </summary> /// <returns>EventsSchemasSet</returns> public static DeviceManagementSchemasSet GetInstance() { if (_instance == null) { _instance = new DeviceManagementSchemasSet(); } return(_instance); }