当前位置: 首页>>代码示例>>C#>>正文


C# MessageEncoder类代码示例

本文整理汇总了C#中MessageEncoder的典型用法代码示例。如果您正苦于以下问题:C# MessageEncoder类的具体用法?C# MessageEncoder怎么用?C# MessageEncoder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MessageEncoder类属于命名空间,在下文中一共展示了MessageEncoder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConverterMessageDeliveryReader

 public ConverterMessageDeliveryReader(ContractDescription[] contracts, Stream stream, bool isOwner, MessageEncoder encoder, int maxSizeOfHeaders)
     : base(stream, isOwner)
 {
     MaxSizeOfHeaders = maxSizeOfHeaders;
     Encoder = encoder;
     _contracts = contracts;
 }
开发者ID:jezell,项目名称:iserviceoriented,代码行数:7,代码来源:ConverterMessageDeliveryReader.cs

示例2: GZipMessageEncoder

 //We require an inner encoder to be supplied (see comment above)
 internal GZipMessageEncoder(MessageEncoder messageEncoder)
     : base()
 {
     if (messageEncoder == null)
         throw new ArgumentNullException("messageEncoder", "A valid message encoder must be passed to the GZipEncoder");
     innerEncoder = messageEncoder;
 }
开发者ID:cleancodenz,项目名称:ServiceBus,代码行数:8,代码来源:GZipMessageEncoder.cs

示例3: CustomTextMessageEncoderFactory

 internal CustomTextMessageEncoderFactory( string mediaType, string charSet, MessageVersion version )
 {
     _version = version;
     _mediaType = mediaType;
     _charSet = charSet;
     _encoder = new CustomTextMessageEncoder( this );
 }
开发者ID:Sn3b,项目名称:Omniture-API,代码行数:7,代码来源:CustomTextMessageEncoderFactory.cs

示例4: ReverseWebProxy

        public ReverseWebProxy(Uri upstreamUri, Uri downstreamUri, TransportClientEndpointBehavior credentials)
        {
            this.upstreamUri = upstreamUri;
            this.downstreamUri = downstreamUri;

            this.upstreamBasePath = this.upstreamUri.PathAndQuery;
            if (this.upstreamBasePath.EndsWith("/"))
            {
                this.upstreamBasePath = this.upstreamBasePath.Substring(0, this.upstreamBasePath.Length - 1);
            }

            ServicePointManager.DefaultConnectionLimit = 50;

            WebHttpRelayBinding relayBinding = new WebHttpRelayBinding(EndToEndWebHttpSecurityMode.None, RelayClientAuthenticationType.None);
            relayBinding.MaxReceivedMessageSize = int.MaxValue;
            relayBinding.TransferMode = TransferMode.Streamed;
            relayBinding.AllowCookies = false;
            relayBinding.ReceiveTimeout = TimeSpan.MaxValue;
            relayBinding.ReaderQuotas.MaxArrayLength = int.MaxValue;
            relayBinding.ReaderQuotas.MaxStringContentLength = int.MaxValue;
            this.upstreamBinding = relayBinding;

            WebMessageEncodingBindingElement encoderBindingElement = new WebMessageEncodingBindingElement();
            encoderBindingElement.ReaderQuotas.MaxArrayLength = int.MaxValue;
            encoderBindingElement.ReaderQuotas.MaxStringContentLength = int.MaxValue;
            encoderBindingElement.ContentTypeMapper = new RawContentTypeMapper();
            encoder = encoderBindingElement.CreateMessageEncoderFactory().Encoder;

            this.credentials = credentials;
        }
开发者ID:RobBlackwell,项目名称:ServiceBusReverseWebProxy,代码行数:30,代码来源:ReverseWebProxy.cs

示例5: WebScriptMetadataMessageEncoder

 public WebScriptMetadataMessageEncoder(XmlDictionaryReaderQuotas quotas)
 {
     this.readerQuotas = new XmlDictionaryReaderQuotas();
     quotas.CopyTo(this.readerQuotas);
     this.mediaType = this.contentType = applicationJavaScriptMediaType;
     this.innerReadMessageEncoder = new TextMessageEncodingBindingElement(MessageVersion.None, Encoding.UTF8).CreateMessageEncoderFactory().Encoder;
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:WebScriptMetadataMessageEncoderFactory.cs

示例6: XeroMessageEncoderFactory

        public XeroMessageEncoderFactory(MessageEncoderFactory innerEncoderFactory)
        {
            if (innerEncoderFactory == null)
                throw new ArgumentNullException("innerEncoderFactory");

            _encoder = new XeroMessageEncoder(innerEncoderFactory.Encoder);
        }
开发者ID:Dozey,项目名称:XeroAPI,代码行数:7,代码来源:XeroMessageEncoderFactory.cs

示例7: SerialChannelBase

        /// <summary>
        /// SerialChannel Base
        /// </summary>
        /// <param name="bufferManager">
        /// Buffer manager created by factory and listener</param>
        /// <param name="encoderFactory">
        /// Referece to encoder factory as returned by encoder element</param>
        /// <param name="address">Remote address</param>
        /// <param name="portNumber">COM port number</param>
        /// <param name="parent">reference to factory/listener</param>
        /// <param name="maxReceivedMessageSize">
        /// Some settings for transport channel</param>
        public SerialChannelBase(BufferManager bufferManager, 
            MessageEncoderFactory encoderFactory, 
            EndpointAddress address,
            string portNumber,
            ChannelManagerBase parent,
            long maxReceivedMessageSize)
            : base(parent)
        {
            this.address = address;
            this.bufferManager = bufferManager;
            this.encoder = encoderFactory.CreateSessionEncoder();
            this.maxReceivedMessageSize = maxReceivedMessageSize;

            this.portNumber = portNumber;

            // Create port
            serialPort = new SerialPort();

            // Set the appropriate properties.
            serialPort.PortName = this.portNumber;
            //TODO: Read these settings from configuration file
            serialPort.BaudRate = 9600;
            serialPort.Parity = Parity.None;
            serialPort.DataBits = 8;
            serialPort.StopBits = StopBits.One;
            serialPort.Handshake = Handshake.None;

            // Set the read/write timeouts
            serialPort.ReadTimeout = 500;
            serialPort.WriteTimeout = 500;
        }
开发者ID:gitlabuser,项目名称:warehouse,代码行数:43,代码来源:SerialChannelBase.cs

示例8: GZipMessageEncoderFactory

        //The GZip encoder wraps an inner encoder
        //We require a factory to be passed in that will create this inner encoder
        public GZipMessageEncoderFactory(MessageEncoderFactory messageEncoderFactory)
        {
            if (messageEncoderFactory == null)
                throw new ArgumentNullException("messageEncoderFactory", "A valid message encoder factory must be passed to the GZipEncoder");
            encoder = new GZipMessageEncoder(messageEncoderFactory.Encoder);

        }
开发者ID:ssickles,项目名称:archive,代码行数:9,代码来源:GZipMessageEncoderFactory.cs

示例9: DecodeSessiongramMessage

 private static Message DecodeSessiongramMessage(MsmqInputSessionChannelListener listener, MsmqInputSessionChannel channel, MessageEncoder encoder, MsmqMessageProperty messageProperty, byte[] buffer, int offset, int size)
 {
     Message message2;
     if (size > listener.MaxReceivedMessageSize)
     {
         channel.FaultChannel();
         listener.MsmqReceiveHelper.FinalDisposition(messageProperty);
         throw listener.NormalizePoisonException(messageProperty.LookupId, MaxMessageSizeStream.CreateMaxReceivedMessageSizeExceededException(listener.MaxReceivedMessageSize));
     }
     if ((size + offset) > buffer.Length)
     {
         listener.MsmqReceiveHelper.FinalDisposition(messageProperty);
         throw listener.NormalizePoisonException(messageProperty.LookupId, new ProtocolException(System.ServiceModel.SR.GetString("MsmqBadFrame")));
     }
     byte[] dst = listener.BufferManager.TakeBuffer(size);
     Buffer.BlockCopy(buffer, offset, dst, 0, size);
     try
     {
         Message message = null;
         using (MsmqDiagnostics.BoundDecodeOperation())
         {
             message = encoder.ReadMessage(new ArraySegment<byte>(dst, 0, size), listener.BufferManager);
             MsmqDiagnostics.TransferFromTransport(message);
         }
         message2 = message;
     }
     catch (XmlException exception)
     {
         channel.FaultChannel();
         listener.MsmqReceiveHelper.FinalDisposition(messageProperty);
         throw listener.NormalizePoisonException(messageProperty.LookupId, new ProtocolException(System.ServiceModel.SR.GetString("MsmqBadXml"), exception));
     }
     return message2;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:34,代码来源:MsmqDecodeHelper.cs

示例10: XeroMessageEncoder

        public XeroMessageEncoder(MessageEncoder innerEncoder)
        {
            if (innerEncoder == null)
                throw new ArgumentNullException("innerEncoder");

            _encoder = innerEncoder;
        }
开发者ID:Dozey,项目名称:XeroAPI,代码行数:7,代码来源:XeroMessageEncoder.cs

示例11: RabbitMQTransportOutputChannel

        public RabbitMQTransportOutputChannel(BindingContext context, EndpointAddress address, Uri via)
            : base(context, address, via)
        {
            _bindingElement = context.Binding.Elements.Find<RabbitMQTransportBindingElement>();

            MessageEncodingBindingElement encoderElement;

            if (_bindingElement.MessageFormat == MessageFormat.MTOM)
            {
                encoderElement = context.Binding.Elements.Find<MtomMessageEncodingBindingElement>();
            }
            else if (_bindingElement.MessageFormat == MessageFormat.NetBinary)
            {
                encoderElement = context.Binding.Elements.Find<BinaryMessageEncodingBindingElement>();
            }
            else
            {
                encoderElement = context.Binding.Elements.Find<TextMessageEncodingBindingElement>();
            }

            if (encoderElement != null)
            {
                _encoder = encoderElement.CreateMessageEncoderFactory().Encoder;
            }

            _messageProcessor = context.BindingParameters.Find<IFaultMessageProcessor>();
        }
开发者ID:parshim,项目名称:MessageBus,代码行数:27,代码来源:RabbitMQTransportOutputChannel.cs

示例12: SmevServiceMessageEncoder

 public SmevServiceMessageEncoder(SmevServiceMessageEncoderFactory factory)
 {
     _factory = factory;
     _innerEncoder = factory.InnerMessageFactory.Encoder;
     _contentType = _factory.MediaType;
     LogPath = _factory.LogPath;
 }
开发者ID:Kilovatiy,项目名称:TestSmevServiceV2,代码行数:7,代码来源:SmevServiceMessageEncoder.cs

示例13: FillMessageEncoder

		void FillMessageEncoder (BindingContext ctx)
		{
			var mbe = (MessageEncodingBindingElement) ctx.Binding.Elements.FirstOrDefault (be => be is MessageEncodingBindingElement);
			if (mbe == null)
				mbe = new TextMessageEncodingBindingElement ();
			message_encoder = mbe.CreateMessageEncoderFactory ().Encoder;
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:UdpDuplexChannel.cs

示例14: AzureProxyHandler

        public AzureProxyHandler(Uri requestUrl, Uri responseUrl)
        {
            _credentials = new TransportClientEndpointBehavior {
                CredentialType = TransportClientCredentialType.SharedSecret
            };
            _credentials.Credentials.SharedSecret.IssuerName = Manager.Configuration.Azure.IssuerName;
            _credentials.Credentials.SharedSecret.IssuerSecret = Manager.Configuration.Azure.IssuerSecret;

            Init(requestUrl, responseUrl);

            ServicePointManager.DefaultConnectionLimit = 50;

            _requestBinding = new BasicHttpRelayBinding(EndToEndBasicHttpSecurityMode.None, RelayClientAuthenticationType.None);
            _requestBinding.MaxReceivedMessageSize = int.MaxValue;
            _requestBinding.TransferMode = TransferMode.Streamed;
            _requestBinding.AllowCookies = false;
            _requestBinding.ReceiveTimeout = TimeSpan.MaxValue;
            _requestBinding.ReaderQuotas.MaxArrayLength = int.MaxValue;
            _requestBinding.ReaderQuotas.MaxStringContentLength = int.MaxValue;
            _requestBinding.MaxReceivedMessageSize = int.MaxValue;
            _requestBinding.MaxBufferSize = 4 * 1024 * 1024;
            _requestBinding.MaxBufferPoolSize = 32 * 4 * 1024 * 1024;

            WebMessageEncodingBindingElement encoderBindingElement = new WebMessageEncodingBindingElement();
            encoderBindingElement.ReaderQuotas.MaxArrayLength = int.MaxValue;
            encoderBindingElement.ReaderQuotas.MaxStringContentLength = int.MaxValue;
            encoderBindingElement.ReaderQuotas.MaxDepth = 128;
            encoderBindingElement.ReaderQuotas.MaxBytesPerRead = 65536;
            encoderBindingElement.ContentTypeMapper = new RawContentTypeMapper();
            _webEncoder = encoderBindingElement.CreateMessageEncoderFactory().Encoder;
        }
开发者ID:managedfusion,项目名称:managedfusion-rewriter-proxy,代码行数:31,代码来源:AzureProxyHandler.cs

示例15: MockChannelBase

    public MockChannelBase(ChannelManagerBase manager, MessageEncoderFactory encoderFactory, EndpointAddress address)
    : base(manager)
    {
        _address = address;
        _manager = manager;
        _encoder = encoderFactory.CreateSessionEncoder();

        OpenAsyncResult = new MockAsyncResult();
        CloseAsyncResult = new MockAsyncResult();

        GetEndpointPropertyOverride = DefaultGetEndpointProperty;

        // CommunicationObject overrides
        DefaultCloseTimeoutOverride = DefaultDefaultCloseTimeout;
        DefaultOpenTimeoutOverride = DefaultDefaultOpenTimeout;

        OnAbortOverride = DefaultOnAbort;
        OnOpenOverride = DefaultOnOpen;
        OnCloseOverride = DefaultOnClose;

        OnBeginOpenOverride = DefaultOnBeginOpen;
        OnEndOpenOverride = DefaultOnEndOpen;

        OnBeginCloseOverride = DefaultOnBeginClose;
        OnEndCloseOverride = DefaultOnEndClose;

        // All the virtuals
        OnOpeningOverride = DefaultOnOpening;
        OnOpenedOverride = DefaultOnOpened;
        OnClosingOverride = DefaultOnClosing;
        OnClosedOverride = DefaultOnClosed;
        OnFaultedOverride = DefaultOnFaulted;
    }
开发者ID:KKhurin,项目名称:wcf,代码行数:33,代码来源:MockChannelBase.cs


注:本文中的MessageEncoder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。