protected object ReadReferencedElement(string name, string ns)
        {
            XmlQualifiedName qname = GetXsiType();

            if (qname == null)
            {
                qname = new XmlQualifiedName(name, ns);
            }

            string id = Reader.GetAttribute("id");
            object ob;

            // it takes precedence over xsi:type.
            // Sometimes there are array types in WSDL,
            // which are not reflected in client proxies.
            // In SOAP messages, they are marked
            // soap-env:arrayType, so use it (this could coexist
            // with xsi:type, which indicates the type in WSDL).
            // See bug #79057.
            string arrayTypeVal = Reader.GetAttribute(arrayType, soapNS);

            if (qname == arrayQName || arrayTypeVal != null && arrayTypeVal.Length > 0)
            {
                CollectionFixup fixup = (collFixups != null) ? (CollectionFixup)collFixups[id] : null;
                if (ReadList(out ob))
                {
                    // List complete (does not contain references)
                    if (fixup != null)
                    {
                        fixup.Callback(fixup.Collection, ob);
                        collFixups.Remove(id);
                        ob = fixup.Collection;
                    }
                }
                else if (fixup != null)
                {
                    fixup.CollectionItems = (object[])ob;
                    ob = fixup.Collection;
                }
            }
            else
            {
                WriteCallbackInfo info = GetCallbackInfo(qname);
                if (info == null)
                {
                    ob = ReadTypedPrimitive(qname, id != null);
                }
                else
                {
                    ob = info.Callback();
                }
            }
            AddTarget(id, ob);
            return(ob);
        }
        protected void AddFixup(CollectionFixup fixup)
        {
            collFixups            = EnsureHashtable(collFixups);
            collFixups [fixup.Id] = fixup;

            if (delayedListFixups != null && delayedListFixups.ContainsKey(fixup.Id))
            {
                fixup.CollectionItems = delayedListFixups [fixup.Id];
                delayedListFixups.Remove(fixup.Id);
            }
        }
Example #3
0
        protected object ReadReferencedElement(string name, string ns)
        {
            XmlQualifiedName qname = GetXsiType();

            if (qname == null)
            {
                qname = new XmlQualifiedName(name, ns);
            }

            string id = Reader.GetAttribute("id");
            object ob;

            if (qname == arrayQName)
            {
                CollectionFixup fixup = (collFixups != null) ? (CollectionFixup)collFixups[id] : null;
                if (ReadList(out ob))
                {
                    // List complete (does not contain references)
                    if (fixup != null)
                    {
                        fixup.Callback(fixup.Collection, ob);
                        collFixups.Remove(id);
                        ob = fixup.Collection;
                    }
                }
                else if (fixup != null)
                {
                    fixup.CollectionItems = (object[])ob;
                    ob = fixup.Collection;
                }
            }
            else
            {
                WriteCallbackInfo info = GetCallbackInfo(qname);
                if (info == null)
                {
                    ob = ReadTypedPrimitive(qname);
                }
                else
                {
                    ob = info.Callback();
                }
            }
            AddTarget(id, ob);
            return(ob);
        }
		protected void AddFixup (CollectionFixup fixup)
		{
			collFixups = EnsureHashtable (collFixups);
			collFixups [fixup.Id] = fixup;

			if (delayedListFixups != null && delayedListFixups.ContainsKey (fixup.Id)) {
				fixup.CollectionItems = delayedListFixups [fixup.Id];
				delayedListFixups.Remove (fixup.Id);
			}
		}
 /// <include file='doc\XmlSerializationReader.uex' path='docs/doc[@for="XmlSerializationReader.AddFixup2"]/*' />
 protected void AddFixup(CollectionFixup fixup) {
     if (collectionFixups == null) collectionFixups = new ArrayList();
     collectionFixups.Add(fixup);
 }
 protected void AddFixup(CollectionFixup fixup)
 {
     if (this.collectionFixups == null)
     {
         this.collectionFixups = new ArrayList();
     }
     this.collectionFixups.Add(fixup);
 }