public static String GetStorageConnectionStringForApplication()
        {
            String config = null;
            ChannelFactory <IStorageBrokerChannel> channelFactory = null;
            IStorageBrokerChannel channel = null;

            try
            {
                channelFactory = GetChannelFactory();
                channel        = channelFactory.CreateChannel();

                channel.Open();

                config = channel.GetStorageConnectionStringForApplication();
            }
            catch (Exception e)
            {
                throw new SystemException(
                          "Unable to retrieve storage connection string for application}", e);
            }
            finally
            {
                if ((channel != null) && (channel.State == CommunicationState.Opened))
                {
                    channel.Close();
                }
                if ((channelFactory != null) && (channelFactory.State == CommunicationState.Opened))
                {
                    channelFactory.Close();
                }
            }

            return(config);
        }
        public static String GetStorageConnectionStringForClient(String clientId)
        {
            String connString = String.Empty;
            ChannelFactory <IStorageBrokerChannel> channelFactory = null;
            IStorageBrokerChannel channel = null;

            try
            {
                channelFactory = GetChannelFactory();
                channel        = channelFactory.CreateChannel();

                channel.Open();

                connString = channel.GetStorageConnectionStringForClient(clientId);
            }
            catch (Exception e)
            {
                throw new SystemException(
                          String.Format("Unable to retrieve storage connection string for client: {0}", clientId), e);
            }
            finally
            {
                if ((channel != null) && (channel.State == CommunicationState.Opened))
                {
                    channel.Close();
                }
                if ((channelFactory != null) && (channelFactory.State == CommunicationState.Opened))
                {
                    channelFactory.Close();
                }
            }

            return(connString);
        }
        public static AzureClientInterface.ServiceBusConfiguration GetServiceBusConfiguration(String clientId)
        {
            AzureClientInterface.ServiceBusConfiguration config         = null;
            ChannelFactory <IStorageBrokerChannel>       channelFactory = null;
            IStorageBrokerChannel channel = null;

            try
            {
                channelFactory = GetChannelFactory();
                channel        = channelFactory.CreateChannel();

                channel.Open();

                config = channel.GetServiceBusConfiguration(clientId);
            }
            catch (Exception e)
            {
                throw new SystemException(
                          String.Format("Unable to retrieve service bus configuration for client: {0}", clientId), e);
            }
            finally
            {
                if ((channel != null) && (channel.State == CommunicationState.Opened))
                {
                    channel.Close();
                }
                if ((channelFactory != null) && (channelFactory.State == CommunicationState.Opened))
                {
                    channelFactory.Close();
                }
            }

            return(config);
        }