/// <summary>
        /// Creates the binding elements.
        /// </summary>
        /// <returns></returns>
        public override BindingElementCollection CreateBindingElements()
        {
            var c = new BindingElementCollection();

            c.AddRange(base.CreateBindingElements());
            return(c.Clone());
        }
Пример #2
0
        private Binding GetSoapBinding()
        {
            BindingElementCollection bindingCollection = new BindingElementCollection();

            if (!UseOAuth2Authentication)
            {
                bindingCollection.Add(SecurityBindingElement.CreateUserNameOverTransportBindingElement());
            }
            bindingCollection.AddRange(new TextMessageEncodingBindingElement
            {
                MessageVersion = MessageVersion.Soap12WSAddressingAugust2004,
                ReaderQuotas   =
                {
                    MaxDepth               =           32,
                    MaxStringContentLength = int.MaxValue,
                    MaxArrayLength         = int.MaxValue,
                    MaxBytesPerRead        = int.MaxValue,
                    MaxNameTableCharCount  = int.MaxValue
                }
            },
                                       new HttpsTransportBindingElement
            {
                TransferMode           = TransferMode.Buffered,
                MaxReceivedMessageSize = 655360000,
                MaxBufferSize          = 655360000,
                KeepAliveEnabled       = true
            });

            return(new CustomBinding(bindingCollection)
            {
                Name = "UserNameSoapBinding",
                Namespace = "Core.Soap",
                CloseTimeout = new TimeSpan(0, 50, 0),
                OpenTimeout = new TimeSpan(0, 50, 0),
                ReceiveTimeout = new TimeSpan(0, 50, 0),
                SendTimeout = new TimeSpan(0, 50, 0)
            });
        }