Esempio n. 1
0
 public UTF8BufferedMessageData(TextMessageEncoder messageEncoder, int maxReaderPoolSize)
     : base(messageEncoder.RecycledStatePool)
 {
     _messageEncoder = messageEncoder;
     _readerPool     = new Pool <XmlDictionaryReader>(maxReaderPoolSize);
     _onClose        = new OnXmlDictionaryReaderClose(OnXmlReaderClosed);
 }
Esempio n. 2
0
 public HttpChannelListener(HttpTransportBindingElement source, BindingContext context) : base(context)
 {
     this.Source = source;
     if (Uri != null && source.Scheme != Uri.Scheme)
     {
         throw new ArgumentException(String.Format("Requested listen uri scheme must be {0}, but was {1}.", source.Scheme, Uri.Scheme));
     }
     foreach (BindingElement be in context.Binding.Elements)
     {
         MessageEncodingBindingElement mbe = be as MessageEncodingBindingElement;
         if (mbe != null)
         {
             MessageEncoder = CreateEncoder <TChannel>(mbe);
             break;
         }
     }
     if (MessageEncoder == null)
     {
         MessageEncoder = new TextMessageEncoder(MessageVersion.Default, Encoding.UTF8);
     }
     if (context.BindingParameters.Contains(typeof(ServiceCredentials)))
     {
         SecurityTokenManager = new ServiceCredentialsSecurityTokenManager((ServiceCredentials)context.BindingParameters[typeof(ServiceCredentials)]);
     }
 }
        public void SetUp()
        {
            session = new Mock<ISession> { DefaultValue = DefaultValue.Mock };

            SetupMessageCreation();

            testee = new TextMessageEncoder();
        }
Esempio n. 4
0
        public void SetUp()
        {
            session = new Mock <ISession> {
                DefaultValue = DefaultValue.Mock
            };

            SetupMessageCreation();

            testee = new TextMessageEncoder();
        }
        public HttpChannelListener(HttpTransportBindingElement source, BindingContext context)
            : base(context)
        {
            if (ServiceHostBase.CurrentServiceHostHack != null)
            {
                DispatcherBuilder.ChannelDispatcherSetter = delegate(ChannelDispatcher cd)
                {
                    this.ChannelDispatcher = cd;
                }
            }
            ;

            this.Source = source;
            // The null Uri check looks weird, but it seems the listener can be built without it.
            // See HttpTransportBindingElementTest.BuildChannelListenerWithoutListenUri().
            if (Uri != null && source.Scheme != Uri.Scheme)
            {
                throw new ArgumentException(String.Format("Requested listen uri scheme must be {0}, but was {1}.", source.Scheme, Uri.Scheme));
            }

            foreach (BindingElement be in context.Binding.Elements)
            {
                MessageEncodingBindingElement mbe = be as MessageEncodingBindingElement;
                if (mbe != null)
                {
                    MessageEncoder = CreateEncoder <TChannel> (mbe);
                    break;
                }
            }
            if (MessageEncoder == null)
            {
                MessageEncoder = new TextMessageEncoder(MessageVersion.Default, Encoding.UTF8);
            }

            if (context.BindingParameters.Contains(typeof(ServiceCredentials)))
            {
                SecurityTokenManager = new ServiceCredentialsSecurityTokenManager((ServiceCredentials)context.BindingParameters [typeof(ServiceCredentials)]);
            }
        }
Esempio n. 6
0
                //XmlDictionaryWriter writer;

                public TextBufferedMessageWriter(TextMessageEncoder messageEncoder)
                {
                    _messageEncoder = messageEncoder;
                }
Esempio n. 7
0
 public TextMessageEncoderFactory(MessageVersion version, Encoding writeEncoding, int maxReadPoolSize, int maxWritePoolSize, XmlDictionaryReaderQuotas quotas)
 {
     _messageEncoder = new TextMessageEncoder(version, writeEncoding, maxReadPoolSize, maxWritePoolSize, quotas);
 }