コード例 #1
0
        private Message ReadStreamedMessage(Stream inputStream)
        {
            Message message;
            MaxMessageSizeStream innerStream = new MaxMessageSizeStream(inputStream, this.settings.MaxReceivedMessageSize);
            Stream stream = new DrainOnCloseStream(innerStream);

            try
            {
                message = this.messageEncoder.ReadMessage(stream, this.settings.MaxBufferSize, this.ContentType);
            }
            catch (XmlException exception)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ProtocolException(System.ServiceModel.SR.GetString("MessageXmlProtocolError"), exception));
            }
            return(message);
        }
コード例 #2
0
 private Message ReadStreamedMessage(Stream inputStream)
 {
     Message message;
     MaxMessageSizeStream innerStream = new MaxMessageSizeStream(inputStream, this.settings.MaxReceivedMessageSize);
     Stream stream = new DrainOnCloseStream(innerStream);
     try
     {
         message = this.messageEncoder.ReadMessage(stream, this.settings.MaxBufferSize, this.ContentType);
     }
     catch (XmlException exception)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ProtocolException(System.ServiceModel.SR.GetString("MessageXmlProtocolError"), exception));
     }
     return message;
 }