WriteQualifiedName() public method

public WriteQualifiedName ( System localName, System namespaceUri ) : void
localName System
namespaceUri System
return void
コード例 #1
0
 protected override void OnWriteStartHeader(XmlDictionaryWriter writer, MessageVersion messageVersion)
 {
     writer.WriteStartElement(this.Name, this.Namespace);
     writer.WriteXmlnsAttribute(null, _notUnderstoodNs);
     writer.WriteStartAttribute(Message12Strings.QName);
     writer.WriteQualifiedName(_notUnderstoodName, _notUnderstoodNs);
     writer.WriteEndAttribute();
 }
コード例 #2
0
        protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
        {
            writer.WriteStartElement(WsrmFeb2005Strings.Prefix, WsrmFeb2005Strings.FaultCode, this.Namespace);
            writer.WriteXmlnsAttribute(null, this.Namespace);
            writer.WriteQualifiedName(this.Subcode, this.Namespace);
            writer.WriteEndElement();

            bool wsrm11 = this.ReliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11;

            if (wsrm11)
            {
                writer.WriteStartElement(WsrmFeb2005Strings.Prefix, XD.Message12Dictionary.FaultDetail, this.DictionaryNamespace);
            }

            this.fault.WriteDetail(writer);

            if (wsrm11)
            {
                writer.WriteEndElement();
            }
        }
 protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
 {
     writer.WriteStartElement("r", "FaultCode", this.Namespace);
     writer.WriteXmlnsAttribute(null, this.Namespace);
     writer.WriteQualifiedName(this.Subcode, this.Namespace);
     writer.WriteEndElement();
     bool flag = base.ReliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11;
     if (flag)
     {
         writer.WriteStartElement("r", XD.Message12Dictionary.FaultDetail, this.DictionaryNamespace);
     }
     this.fault.WriteDetail(writer);
     if (flag)
     {
         writer.WriteEndElement();
     }
 }
 protected override void OnWriteDetailContents(XmlDictionaryWriter writer)
 {
     writer.WriteStartElement("ProblemHeaderQName", AddressingVersion.WSAddressing10.Namespace);
     writer.WriteQualifiedName(this.invalidHeaderName, AddressingVersion.WSAddressing10.Namespace);
     writer.WriteEndElement();
 }
 protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
 {
     writer.WriteStartElement("ProblemHeaderQName", this.Namespace);
     writer.WriteQualifiedName(this.invalidHeaderName, this.Namespace);
     writer.WriteEndElement();
 }
コード例 #6
0
ファイル: DataContractSerializer.cs プロジェクト: cthrax/mono
		public override void WriteStartObject (
			XmlDictionaryWriter writer, object graph)
		{
			Type rootType = type;
			
			if (root_name.Value == "")
				throw new InvalidDataContractException ("Type '" + type.ToString () +
					"' cannot have a DataContract attribute Name set to null or empty string.");


			if (graph == null) {
				if (names_filled)
					writer.WriteStartElement (root_name.Value, root_ns.Value);
				else
					writer.WriteStartElement (root_name, root_ns);
				writer.WriteAttributeString ("i", "nil", XmlSchema.InstanceNamespace, "true");
				return;
			}

			QName instName = null;
			QName root_qname = known_types.GetQName (rootType);
			QName graph_qname = known_types.GetQName (graph.GetType ());

			known_types.Add (graph.GetType ());

			if (names_filled)
				writer.WriteStartElement (root_name.Value, root_ns.Value);
			else
				writer.WriteStartElement (root_name, root_ns);
			if (root_ns.Value != root_qname.Namespace)
				if (root_qname.Namespace != KnownTypeCollection.MSSimpleNamespace)
					writer.WriteXmlnsAttribute (null, root_qname.Namespace);

			if (root_qname == graph_qname) {
				if (root_qname.Namespace != KnownTypeCollection.MSSimpleNamespace &&
					!rootType.IsEnum)
					//FIXME: Hack, when should the "i:type" be written?
					//Not used in case of enums
					writer.WriteXmlnsAttribute ("i", XmlSchema.InstanceNamespace);

				return;
			}

			/* Different names */
			known_types.Add (rootType);
			
			instName = KnownTypeCollection.GetPredefinedTypeName (graph.GetType ());
			if (instName == QName.Empty)
				/* Not a primitive type */
				instName = graph_qname;
			else
				/* FIXME: Hack, .. see test WriteObject7 () */
				instName = new QName (instName.Name, XmlSchema.Namespace);

			// output xsi:type as rootType is not equivalent to the graph's type.
			writer.WriteStartAttribute ("i", "type", XmlSchema.InstanceNamespace);
			writer.WriteQualifiedName (instName.Name, instName.Namespace);
			writer.WriteEndAttribute ();
		}
コード例 #7
0
 public override void WriteQualifiedName(string localName, string namespaceUri)
 {
     writer.WriteQualifiedName(localName, namespaceUri);
 }