public static void ReadHeaderValue(XmlDictionaryReader reader, AddressingVersion version, out Uri relationshipType, out System.Xml.UniqueId messageId) { AddressingDictionary addressingDictionary = XD.AddressingDictionary; relationshipType = ReplyRelationshipType; messageId = reader.ReadElementContentAsUniqueId(); }
static MessagePatterns() { BinaryFormatBuilder builder = new BinaryFormatBuilder(); MessageDictionary messageDictionary = XD.MessageDictionary; Message12Dictionary dictionary2 = XD.Message12Dictionary; AddressingDictionary addressingDictionary = XD.AddressingDictionary; Addressing10Dictionary dictionary4 = XD.Addressing10Dictionary; char prefix = "s"[0]; char ch2 = "a"[0]; builder.AppendPrefixDictionaryElement(prefix, builder.GetStaticKey(messageDictionary.Envelope.Key)); builder.AppendDictionaryXmlnsAttribute(prefix, builder.GetStaticKey(dictionary2.Namespace.Key)); builder.AppendDictionaryXmlnsAttribute(ch2, builder.GetStaticKey(dictionary4.Namespace.Key)); builder.AppendPrefixDictionaryElement(prefix, builder.GetStaticKey(messageDictionary.Header.Key)); builder.AppendPrefixDictionaryElement(ch2, builder.GetStaticKey(addressingDictionary.Action.Key)); builder.AppendPrefixDictionaryAttribute(prefix, builder.GetStaticKey(messageDictionary.MustUnderstand.Key), '1'); builder.AppendDictionaryTextWithEndElement(); commonFragment = builder.ToByteArray(); builder.AppendPrefixDictionaryElement(ch2, builder.GetStaticKey(addressingDictionary.MessageId.Key)); builder.AppendUniqueIDWithEndElement(); requestFragment1 = builder.ToByteArray(); builder.AppendPrefixDictionaryElement(ch2, builder.GetStaticKey(addressingDictionary.ReplyTo.Key)); builder.AppendPrefixDictionaryElement(ch2, builder.GetStaticKey(addressingDictionary.Address.Key)); builder.AppendDictionaryTextWithEndElement(builder.GetStaticKey(dictionary4.Anonymous.Key)); builder.AppendEndElement(); builder.AppendPrefixDictionaryElement(ch2, builder.GetStaticKey(addressingDictionary.To.Key)); builder.AppendPrefixDictionaryAttribute(prefix, builder.GetStaticKey(messageDictionary.MustUnderstand.Key), '1'); builder.AppendDictionaryTextWithEndElement(builder.GetSessionKey(1)); builder.AppendEndElement(); builder.AppendPrefixDictionaryElement(prefix, builder.GetStaticKey(messageDictionary.Body.Key)); requestFragment2 = builder.ToByteArray(); builder.AppendPrefixDictionaryElement(ch2, builder.GetStaticKey(addressingDictionary.RelatesTo.Key)); builder.AppendUniqueIDWithEndElement(); responseFragment1 = builder.ToByteArray(); builder.AppendPrefixDictionaryElement(ch2, builder.GetStaticKey(addressingDictionary.To.Key)); builder.AppendPrefixDictionaryAttribute(prefix, builder.GetStaticKey(messageDictionary.MustUnderstand.Key), '1'); builder.AppendDictionaryTextWithEndElement(builder.GetStaticKey(dictionary4.Anonymous.Key)); builder.AppendEndElement(); builder.AppendPrefixDictionaryElement(prefix, builder.GetStaticKey(messageDictionary.Body.Key)); responseFragment2 = builder.ToByteArray(); builder.AppendPrefixDictionaryElement(prefix, builder.GetStaticKey(messageDictionary.Envelope.Key)); builder.AppendDictionaryXmlnsAttribute(prefix, builder.GetStaticKey(dictionary2.Namespace.Key)); builder.AppendDictionaryXmlnsAttribute(ch2, builder.GetStaticKey(dictionary4.Namespace.Key)); builder.AppendPrefixDictionaryElement(prefix, builder.GetStaticKey(messageDictionary.Body.Key)); bodyFragment = builder.ToByteArray(); }
public static void ReadHeaderValue(XmlDictionaryReader reader, AddressingVersion version, out Uri relationshipType, out UniqueId messageId) { AddressingDictionary addressingDictionary = XD.AddressingDictionary; // The RelationshipType attribute has no namespace. relationshipType = ReplyRelationshipType; /* * string relation = reader.GetAttribute(addressingDictionary.RelationshipType, addressingDictionary.Empty); * if (relation == null) * { * relationshipType = ReplyRelationshipType; * } * else * { * relationshipType = new Uri(relation); * } */ Fx.Assert(reader.IsStartElement(addressingDictionary.RelatesTo, version.DictionaryNamespace), ""); messageId = reader.ReadElementContentAsUniqueId(); }