/// <summary>
 /// Creates the <see cref="Binding"/> used for the endpoint.
 /// </summary>
 /// <param name="bindingType">The binding type.</param>
 /// <returns>An instance of <see cref="Binding"/>.</returns>
 protected virtual Binding CreateBinding(HttpBindingType bindingType)
 {
     switch (bindingType)
     {
         case HttpBindingType.BasicHttp:
             return (BindingConfiguration == null)
                        ? new BasicHttpBinding()
                        : new BasicHttpBinding(BindingConfiguration);
         case HttpBindingType.WSHttp:
             return (BindingConfiguration == null)
                        ? new WSHttpBinding()
                        : new WSHttpBinding(BindingConfiguration);
         default:
             throw new ArgumentNullException("Unsupported binding type: " + bindingType);
     }
 }
        /// <summary>
        /// Creates the <see cref="Binding"/> used for the endpoint.
        /// </summary>
        /// <param name="bindingType">The binding type.</param>
        /// <returns>An instance of <see cref="Binding"/>.</returns>
        protected virtual Binding CreateBinding(HttpBindingType bindingType)
        {
            switch (bindingType)
            {
            case HttpBindingType.BasicHttp:
                return((BindingConfiguration == null)
                               ? new BasicHttpBinding()
                               : new BasicHttpBinding(BindingConfiguration));

            case HttpBindingType.WSHttp:
                return((BindingConfiguration == null)
                               ? new WSHttpBinding()
                               : new WSHttpBinding(BindingConfiguration));

            default:
                throw new ArgumentNullException("Unsupported binding type: " + bindingType);
            }
        }