private void InitNetOnewayRelayClient() { string issuerName = tsSolutionName.Text; string issuerKey = tsSolutionPassword.Text; string serviceNamespaceDomain = tsSolutionToConnect.Text; try { Uri address = ServiceBusEnvironment.CreateServiceUri("sb", serviceNamespaceDomain, "OnewayEnergyServiceOperations"); netOnewayChannelFactory = new ChannelFactory <IOnewayEnergyServiceChannel>("RelayEndpoint", new EndpointAddress(address)); netOnewayChannel = ServiceBusHelper.GetOneWayEnergyChannel(netOnewayChannelFactory); ClearLog(); AddLog("Connected"); AddLog(netOnewayChannelFactory.Endpoint.Address.Uri.ToString()); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }