Exemple #1
0
        public CustomBinding(params BindingElement[] bindingElementsInTopDownChannelStackOrder)
            : base()
        {
            if (bindingElementsInTopDownChannelStackOrder == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("bindingElements");
            }

            foreach (BindingElement element in bindingElementsInTopDownChannelStackOrder)
            {
                _bindingElements.Add(element);
            }
        }
Exemple #2
0
        // returns a new collection with clones of all the elements
        public BindingElementCollection Clone()
        {
            BindingElementCollection result = new BindingElementCollection();

            for (int i = 0; i < this.Count; i++)
            {
                result.Add(this[i].Clone());
            }
            return(result);
        }
        public BindingElementCollection Clone()
        {
            BindingElementCollection elements = new BindingElementCollection();

            for (int i = 0; i < base.Count; i++)
            {
                elements.Add(base[i].Clone());
            }
            return(elements);
        }
        private static void ImportAddress(WsdlEndpointConversionContext context, TransportBindingElement transportBindingElement)
        {
            EndpointAddress address = context.Endpoint.Address = WsdlImporter.WSAddressingHelper.ImportAddress(context.WsdlPort);

            if (address != null)
            {
                context.Endpoint.Address = address;
                if ((address.Uri.Scheme == Uri.UriSchemeHttps) && !(transportBindingElement is HttpsTransportBindingElement))
                {
                    BindingElementCollection elements = ConvertToCustomBinding(context).Elements;
                    elements.Remove(transportBindingElement);
                    elements.Add(CreateHttpsFromHttp(transportBindingElement as HttpTransportBindingElement));
                }
            }
        }
        static void ImportAddress(WsdlEndpointConversionContext context, TransportBindingElement transportBindingElement)
        {
            EndpointAddress address = context.Endpoint.Address = WsdlImporter.WSAddressingHelper.ImportAddress(context.WsdlPort);

            if (address != null)
            {
                context.Endpoint.Address = address;

                // Replace the http BE with https BE only if the uri scheme is https and the transport binding element is a HttpTransportBindingElement but not HttpsTransportBindingElement
                if (address.Uri.Scheme == Uri.UriSchemeHttps && transportBindingElement is HttpTransportBindingElement && !(transportBindingElement is HttpsTransportBindingElement))
                {
                    BindingElementCollection elements = ConvertToCustomBinding(context).Elements;
                    elements.Remove(transportBindingElement);
                    elements.Add(CreateHttpsFromHttp(transportBindingElement as HttpTransportBindingElement));
                }
            }
        }
Exemple #6
0
        internal CustomBinding(Binding binding, BindingElementCollection elements)
        {
            if (binding == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("binding");
            }
            if (elements == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("elements");
            }

            this.Name           = binding.Name;
            this.Namespace      = binding.Namespace;
            this.CloseTimeout   = binding.CloseTimeout;
            this.OpenTimeout    = binding.OpenTimeout;
            this.ReceiveTimeout = binding.ReceiveTimeout;
            this.SendTimeout    = binding.SendTimeout;

            for (int i = 0; i < elements.Count; i++)
            {
                bindingElements.Add(elements[i]);
            }
        }