Exemple #1
0
        // check that properties of the HttpTransportBindingElement and
        // MessageEncodingBindingElement not exposed as properties on BasicHttpBinding
        // match default values of the binding elements
        private bool IsBindingElementsMatch(TcpTransportBindingElement transport, BinaryMessageEncodingBindingElement encoding)
        {
            if (!_transport.IsMatch(transport))
            {
                return(false);
            }

            if (!_encoding.IsMatch(encoding))
            {
                return(false);
            }

            if (!_context.IsMatch(_context))
            {
                return(false);
            }

            if (_reliableSession.Enabled)
            {
                if (!_session.IsMatch(_session))
                {
                    return(false);
                }
            }

            return(true);
        }
Exemple #2
0
        private bool IsBindingElementsMatch(HttpTransportBindingElement transport, MessageEncodingBindingElement encoding, ReliableSessionBindingElement session)
        {
            if (_reliableSession.Enabled)
            {
                if (!_session.IsMatch(session))
                {
                    return(false);
                }
            }
            else if (session != null)
            {
                return(false);
            }

            switch (this.MessageEncoding)
            {
            case NetHttpMessageEncoding.Text:
                if (!this.TextMessageEncodingBindingElement.IsMatch(encoding))
                {
                    return(false);
                }

                break;

            case NetHttpMessageEncoding.Mtom:
                if (!this.MtomMessageEncodingBindingElement.IsMatch(encoding))
                {
                    return(false);
                }

                break;

            default:        // NetHttpMessageEncoding.Binary
                if (!_binaryMessageEncodingBindingElement.IsMatch(encoding))
                {
                    return(false);
                }

                break;
            }

            if (!this.GetTransport().IsMatch(transport))
            {
                return(false);
            }

            return(true);
        }
Exemple #3
0
        // check that properties of the HttpTransportBindingElement and
        // MessageEncodingBindingElement not exposed as properties on BasicHttpBinding
        // match default values of the binding elements
        private bool IsBindingElementsMatch(HttpTransportBindingElement transport, MessageEncodingBindingElement encoding, TransactionFlowBindingElement txFlow, ReliableSessionBindingElement session)
        {
            if (!this.GetTransport().IsMatch(transport))
            {
                return(false);
            }
            if (this.MessageEncoding == WSMessageEncoding.Text)
            {
                if (!_textEncoding.IsMatch(encoding))
                {
                    return(false);
                }
            }
            else if (this.MessageEncoding == WSMessageEncoding.Mtom)
            {
                if (!_mtomEncoding.IsMatch(encoding))
                {
                    return(false);
                }
            }
            if (!_txFlow.IsMatch(txFlow))
            {
                return(false);
            }

            if (_reliableSession.Enabled)
            {
                if (!_session.IsMatch(session))
                {
                    return(false);
                }
            }
            else if (session != null)
            {
                return(false);
            }

            return(true);
        }