/// <summary>
		/// Configures and returns an instance of the specified service channel factory, according to the specified arguments.
		/// </summary>
		/// <param name="args"></param>
		/// <returns></returns>
		public ChannelFactory ConfigureChannelFactory(ServiceChannelConfigurationArgs args)
		{
			WSHttpBinding binding = new WSHttpBinding();
			binding.Security.Mode = WebServicesSettings.Default.SecurityMode;
			binding.Security.Message.ClientCredentialType =
				args.AuthenticationRequired ? MessageCredentialType.UserName : MessageCredentialType.None;
			binding.MaxReceivedMessageSize = args.MaxReceivedMessageSize;

			if (args.SendTimeoutSeconds > 0)
				binding.SendTimeout = TimeSpan.FromSeconds(args.SendTimeoutSeconds);

			// allow individual string content to be same size as entire message
			binding.ReaderQuotas.MaxStringContentLength = args.MaxReceivedMessageSize;
			binding.ReaderQuotas.MaxArrayLength = args.MaxReceivedMessageSize;

			//binding.ReceiveTimeout = new TimeSpan(0, 0 , 20);
			//binding.SendTimeout = new TimeSpan(0, 0, 10);

			ChannelFactory channelFactory = (ChannelFactory) Activator.CreateInstance(args.ChannelFactoryClass, binding,
			                                                                          new EndpointAddress(args.ServiceUri));
			channelFactory.Credentials.ServiceCertificate.Authentication.CertificateValidationMode = args.CertificateValidationMode;
			channelFactory.Credentials.ServiceCertificate.Authentication.RevocationMode = args.RevocationMode;

			//TODO (Rockstar): remove this after refactoring to do per-sop edits
			foreach (var operation in channelFactory.Endpoint.Contract.Operations)
				operation.Behaviors.Find<DataContractSerializerOperationBehavior>().MaxItemsInObjectGraph = args.MaxReceivedMessageSize;

			return channelFactory;
		}
        /// <summary>
        /// Configures and returns an instance of the specified service channel factory, according to the specified arguments.
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public ChannelFactory ConfigureChannelFactory(ServiceChannelConfigurationArgs args)
        {
            WSHttpBinding binding = new WSHttpBinding();
            binding.Security.Mode =  WebServicesSettings.Default.SecurityMode;
            binding.Security.Message.ClientCredentialType =
                args.AuthenticationRequired ? MessageCredentialType.UserName : MessageCredentialType.None;
            binding.MaxReceivedMessageSize = args.MaxReceivedMessageSize;

            // allow individual string content to be same size as entire message
            binding.ReaderQuotas.MaxStringContentLength = args.MaxReceivedMessageSize;
            binding.ReaderQuotas.MaxArrayLength = args.MaxReceivedMessageSize;

            //binding.ReceiveTimeout = new TimeSpan(0, 0 , 20);
            //binding.SendTimeout = new TimeSpan(0, 0, 10);

            ChannelFactory channelFactory = (ChannelFactory)Activator.CreateInstance(args.ChannelFactoryClass, binding,
                new EndpointAddress(args.ServiceUri));
            channelFactory.Credentials.ServiceCertificate.Authentication.CertificateValidationMode = args.CertificateValidationMode;
            channelFactory.Credentials.ServiceCertificate.Authentication.RevocationMode = args.RevocationMode;

            return channelFactory;
        }