[Web Services] Fix regression caused by previous commit
authorLluis Sanchez <lluis@novell.com>
Fri, 6 May 2011 16:37:19 +0000 (18:37 +0200)
committerLluis Sanchez <lluis@novell.com>
Fri, 6 May 2011 16:39:51 +0000 (18:39 +0200)
Fixes a regression caused by the implementation of support
for optional parameters. GlobalIndex was not being set
when using SOAP RPC protocol.

mcs/class/System.XML/System.Xml.Serialization/XmlTypeMapMember.cs
mcs/class/System.XML/System.Xml.Serialization/XmlTypeMapping.cs

index 9d2b846d4370bf5a62e3f29e650f12044d2006e0..18eb390584c5e6c848a3c94d7e5109b85a272d25 100644 (file)
@@ -41,7 +41,7 @@ namespace System.Xml.Serialization
        {
                string _name;
                int _index;
-               int _globalIndex;
+               int _globalIndex = -1;
                int _specifiedGlobalIndex = -1;
                TypeData _typeData;
                MemberInfo _member;
index 299aca2d16b66bf195f0a3a24cba9b111e762a1b..752aae73c27d514725370cccbed7de328bfba0b2 100644 (file)
@@ -306,6 +306,10 @@ namespace System.Xml.Serialization
 
                public void AddMember (XmlTypeMapMember member)
                {
+                       // If GlobalIndex has not been set, set it now
+                       if (member.GlobalIndex == -1)
+                               member.GlobalIndex = _allMembers.Count;
+                       
                        _allMembers.Add (member);
                        
                        if (!(member.DefaultValue is System.DBNull) && member.DefaultValue != null) {