コード例 #1
0
        public System.Web.Services.Protocols.Soap12FaultDetail ReadObject_Detail(bool isNullable, bool checkType)
        {
            System.Web.Services.Protocols.Soap12FaultDetail ob = null;
            if (isNullable && ReadNull())
            {
                return(null);
            }

            if (checkType)
            {
                System.Xml.XmlQualifiedName t = GetXsiType();
                if (t == null)
                {
                }
                else if (t.Name != "Detail" || t.Namespace != "http://www.w3.org/2003/05/soap-envelope")
                {
                    throw CreateUnknownTypeException(t);
                }
            }

            ob = new System.Web.Services.Protocols.Soap12FaultDetail();

            Reader.MoveToElement();

            int anyAttributeIndex = 0;

            System.Xml.XmlAttribute[] anyAttributeArray = null;
            while (Reader.MoveToNextAttribute())
            {
                if (IsXmlnsAttribute(Reader.Name))
                {
                }
                else
                {
                    System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute)Document.ReadNode(Reader);
                    anyAttributeArray = (System.Xml.XmlAttribute[])EnsureArrayIndex(anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
                    anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute)attr);
                    anyAttributeIndex++;
                }
            }

            anyAttributeArray = (System.Xml.XmlAttribute[])ShrinkArray(anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
            ob.@Attributes    = anyAttributeArray;

            Reader.MoveToElement();
            if (Reader.IsEmptyElement)
            {
                Reader.Skip();
                return(ob);
            }

            Reader.ReadStartElement();
            Reader.MoveToContent();

            System.Xml.XmlElement[] o8;
            o8 = null;
            int n7 = 0;

            while (Reader.NodeType != System.Xml.XmlNodeType.EndElement)
            {
                if (Reader.NodeType == System.Xml.XmlNodeType.Element)
                {
                    o8     = (System.Xml.XmlElement[])EnsureArrayIndex(o8, n7, typeof(System.Xml.XmlElement));
                    o8[n7] = ((System.Xml.XmlElement)ReadXmlNode(false));
                    n7++;
                }
                else if (Reader.NodeType == System.Xml.XmlNodeType.Text || Reader.NodeType == System.Xml.XmlNodeType.CDATA)
                {
                    ob.@Text = ReadString(ob.@Text);
                }
                else
                {
                    UnknownNode(ob);
                }

                Reader.MoveToContent();
            }

            o8           = (System.Xml.XmlElement[])ShrinkArray(o8, n7, typeof(System.Xml.XmlElement), true);
            ob.@Children = o8;

            ReadEndElement();

            return(ob);
        }
コード例 #2
0
        void WriteObject_Detail(System.Web.Services.Protocols.Soap12FaultDetail ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
        {
            if (((object)ob) == null)
            {
                if (isNullable)
                {
                    WriteNullTagLiteral(element, namesp);
                }
                return;
            }

            System.Type type = ob.GetType();
            if (type == typeof(System.Web.Services.Protocols.Soap12FaultDetail))
            {
            }
            else
            {
                throw CreateUnknownTypeException(ob);
            }

            if (writeWrappingElem)
            {
                WriteStartElement(element, namesp, ob);
            }

            if (needType)
            {
                WriteXsiType("Detail", "http://www.w3.org/2003/05/soap-envelope");
            }

            ICollection o16 = ob.@Attributes;

            if (o16 != null)
            {
                foreach (XmlAttribute o17 in o16)
                {
                    if (o17.NamespaceURI != xmlNamespace)
                    {
                        WriteXmlAttribute(o17, ob);
                    }
                }
            }

            if (ob.@Children != null)
            {
                foreach (XmlNode o18 in ob.@Children)
                {
                    XmlNode o19 = o18;
                    if (o19 is XmlElement)
                    {
                    }
                    else
                    {
                        o19.WriteTo(Writer);
                    }
                    WriteElementLiteral(o19, "", "", false, true);
                }
            }
            WriteValue(ob.@Text);
            if (writeWrappingElem)
            {
                WriteEndElement(ob);
            }
        }
コード例 #3
0
ファイル: Fault12Serializer.cs プロジェクト: nobled/mono
		public System.Web.Services.Protocols.Soap12FaultDetail ReadObject_Detail (bool isNullable, bool checkType)
		{
			System.Web.Services.Protocols.Soap12FaultDetail ob = null;
			if (isNullable && ReadNull()) return null;

			if (checkType) 
			{
				System.Xml.XmlQualifiedName t = GetXsiType();
				if (t == null)
				{ }
				else if (t.Name != "Detail" || t.Namespace != "http://www.w3.org/2003/05/soap-envelope")
					throw CreateUnknownTypeException(t);
			}

			ob = new System.Web.Services.Protocols.Soap12FaultDetail ();

			Reader.MoveToElement();

			int anyAttributeIndex = 0;
			System.Xml.XmlAttribute[] anyAttributeArray = null;
			while (Reader.MoveToNextAttribute())
			{
				if (IsXmlnsAttribute (Reader.Name)) {
				}
				else {
					System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
					anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
					anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
					anyAttributeIndex++;
				}
			}

			anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
			ob.@Attributes = anyAttributeArray;

			Reader.MoveToElement();
			if (Reader.IsEmptyElement) {
				Reader.Skip ();
				return ob;
			}

			Reader.ReadStartElement();
			Reader.MoveToContent();

			System.Xml.XmlElement[] o8;
			o8 = null;
			int n7=0;

			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
			{
				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
				{
					o8 = (System.Xml.XmlElement[]) EnsureArrayIndex (o8, n7, typeof(System.Xml.XmlElement));
					o8[n7] = ((System.Xml.XmlElement) ReadXmlNode (false));
					n7++;
				}
				else if (Reader.NodeType == System.Xml.XmlNodeType.Text || Reader.NodeType == System.Xml.XmlNodeType.CDATA)
				{
					ob.@Text = ReadString (ob.@Text);
				}
				else
					UnknownNode(ob);

				Reader.MoveToContent();
			}

			o8 = (System.Xml.XmlElement[]) ShrinkArray (o8, n7, typeof(System.Xml.XmlElement), true);
			ob.@Children = o8;

			ReadEndElement();

			return ob;
		}