如何在此消息中添加标题并获取所有xml文档?
private Message GetRootMessage()
{
var stream = new MemoryStream();
XmlDictionaryWriter writer = XmlDictionaryWriter.CreateTextWriter(stream);
writer.WriteStartDocument();
writer.WriteStartElement("Body");
writer.WriteAttributeString("abc", "2012-04-17t10:00:00Z");
writer.WriteAttributeString("abd", "CA");
writer.WriteAttributeString("bid", "35353");
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Flush();
stream.Position = 0;
XmlDictionaryReader reader =
XmlDictionaryReader.CreateTextReader(
stream, XmlDictionaryReaderQuotas.Max);
return Message.CreateMessage(
MessageVersion.None, "", reader);
}