public BufferedHeader(MessageVersion version, XmlBuffer buffer, XmlDictionaryReader reader, XmlAttributeHolder[] envelopeAttributes, XmlAttributeHolder[] headerAttributes) { _streamed = true; _buffer = buffer; _version = version; GetHeaderAttributes(reader, version, out _actor, out _mustUnderstand, out _relay, out _isRefParam); _name = reader.LocalName; _ns = reader.NamespaceURI; Fx.Assert(_name != null, ""); Fx.Assert(_ns != null, ""); _bufferIndex = buffer.SectionCount; XmlDictionaryWriter writer = buffer.OpenSection(reader.Quotas); // Write an enclosing Envelope tag writer.WriteStartElement(MessageStrings.Envelope); if (envelopeAttributes != null) { XmlAttributeHolder.WriteAttributes(envelopeAttributes, writer); } // Write and enclosing Header tag writer.WriteStartElement(MessageStrings.Header); if (headerAttributes != null) { XmlAttributeHolder.WriteAttributes(headerAttributes, writer); } writer.WriteNode(reader, false); writer.WriteEndElement(); writer.WriteEndElement(); buffer.CloseSection(); }
protected override void OnWriteStartHeaders(XmlDictionaryWriter writer) { EnvelopeVersion envelope = this.Version.Envelope; writer.WriteStartElement(this.headerPrefix, "Header", envelope.Namespace); XmlAttributeHolder.WriteAttributes(this.headerAttributes, writer); }
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(); }
protected override void OnWriteStartBody(XmlDictionaryWriter writer) { writer.WriteStartElement(this.bodyPrefix, "Body", this.Version.Envelope.Namespace); XmlAttributeHolder.WriteAttributes(this.bodyAttributes, writer); }