Beispiel #1
0
        public BufferedHeader(MessageVersion version, XmlBuffer buffer, XmlDictionaryReader reader, XmlAttributeHolder[] envelopeAttributes, XmlAttributeHolder[] headerAttributes)
        {
            this.streamed = true;
            this.buffer   = buffer;
            this.version  = version;
            MessageHeader.GetHeaderAttributes(reader, version, out this.actor, out this.mustUnderstand, out this.relay, out this.isRefParam);
            this.name        = reader.LocalName;
            this.ns          = reader.NamespaceURI;
            this.bufferIndex = buffer.SectionCount;
            XmlDictionaryWriter writer = buffer.OpenSection(reader.Quotas);

            writer.WriteStartElement("Envelope");
            if (envelopeAttributes != null)
            {
                XmlAttributeHolder.WriteAttributes(envelopeAttributes, writer);
            }
            writer.WriteStartElement("Header");
            if (headerAttributes != null)
            {
                XmlAttributeHolder.WriteAttributes(headerAttributes, writer);
            }
            writer.WriteNode(reader, false);
            writer.WriteEndElement();
            writer.WriteEndElement();
            buffer.CloseSection();
        }