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); }
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; }