Author: lluis
Date: 2005-05-09 06:24:48 -0400 (Mon, 09 May 2005)
New Revision: 44260

Modified:
   
trunk/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/ChangeLog
   
trunk/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapReader.cs
   
trunk/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs
Log:
2005-05-09  Lluis Sanchez Gual <[EMAIL PROTECTED]>

        * SoapReader.cs:
        * SoapWriter.cs: Use InternalRemotingServices.GetCachedSoapAttribute to
        get the name of the fields being serialized. Fixed some warnings.



Modified: 
trunk/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/ChangeLog
===================================================================
--- 
trunk/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/ChangeLog
 2005-05-09 10:17:07 UTC (rev 44259)
+++ 
trunk/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/ChangeLog
 2005-05-09 10:24:48 UTC (rev 44260)
@@ -1,3 +1,9 @@
+2005-05-09  Lluis Sanchez Gual <[EMAIL PROTECTED]>
+
+       * SoapReader.cs:
+       * SoapWriter.cs: Use InternalRemotingServices.GetCachedSoapAttribute to
+       get the name of the fields being serialized. Fixed some warnings.
+
 2005-05-05  Lluis Sanchez Gual <[EMAIL PROTECTED]>
 
        * SoapTypeMapper.cs: Added missing maps for primitive types and

Modified: 
trunk/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapReader.cs
===================================================================
--- 
trunk/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapReader.cs
     2005-05-09 10:17:07 UTC (rev 44259)
+++ 
trunk/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapReader.cs
     2005-05-09 10:24:48 UTC (rev 44260)
@@ -36,6 +36,7 @@
 using System.Runtime.Remoting;
 using System.Runtime.Serialization;
 using System.Runtime.Remoting.Messaging;
+using System.Runtime.Remoting.Metadata;
 
 namespace System.Runtime.Serialization.Formatters.Soap {
        internal sealed class SoapReader {
@@ -739,8 +740,10 @@
                        tm.MemberInfos = 
FormatterServices.GetSerializableMembers (type, _context);
                        
                        tm.Indices      = new Hashtable();
-                       for(int i = 0; i < tm.MemberInfos.Length; i++) 
-                               tm.Indices.Add (tm.MemberInfos[i].Name, i);
+                       for(int i = 0; i < tm.MemberInfos.Length; i++) {
+                               SoapFieldAttribute at = (SoapFieldAttribute) 
InternalRemotingServices.GetCachedSoapAttribute (tm.MemberInfos[i]);
+                               tm.Indices [XmlConvert.EncodeLocalName 
(at.XmlElementName)] = i;
+                       }
                        
                        _fieldIndices[type] = tm;
                        return tm;

Modified: 
trunk/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs
===================================================================
--- 
trunk/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs
     2005-05-09 10:17:07 UTC (rev 44259)
+++ 
trunk/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs
     2005-05-09 10:24:48 UTC (rev 44260)
@@ -32,6 +32,7 @@
 using System.Reflection;
 using System.Collections;
 using System.Runtime.Remoting;
+using System.Runtime.Remoting.Metadata;
 using System.Runtime.Remoting.Messaging;
 using System.Runtime.Serialization;
 using System.Runtime.Serialization.Formatters;
@@ -74,12 +75,10 @@
 
                private XmlTextWriter _xmlWriter;
                private Queue _objectQueue = new Queue();
-               private Hashtable _prefixTable = new Hashtable();
                private Hashtable _objectToIdTable = new Hashtable();
                private ISurrogateSelector _surrogateSelector;
                private SoapTypeMapper _mapper;
                private StreamingContext _context;
-               private ISoapMessage _soapMessage = null;
                private ObjectIDGenerator idGen = new ObjectIDGenerator();
                private FormatterAssemblyStyle _assemblyFormat = 
FormatterAssemblyStyle.Full;
                private FormatterTypeStyle _typeFormat = 
FormatterTypeStyle.TypesWhenNeeded;
@@ -103,7 +102,6 @@
                        _xmlWriter.Formatting = Formatting.Indented;
                        _surrogateSelector = selector;
                        _context = context;
-                       _soapMessage = soapMessage;
 
                }
 
@@ -298,7 +296,6 @@
                        Id(idGen.GetId(message, out firstTime));
 
                        string[] paramNames = message.ParamNames;
-                       Type[] paramTypes = message.ParamTypes;
                        object[] paramValues = message.ParamValues;
                        int length = (paramNames != null)?paramNames.Length:0;
                        for(int i = 0; i < length; i++) 
@@ -380,18 +377,14 @@
                        }
                        else
                        {
-                               MemberInfo[] memberInfos = 
-                                       
FormatterServices.GetSerializableMembers(currentType, _context);
-                               object[] objectData =
-                                       
FormatterServices.GetObjectData(currentObject, memberInfos);
-//                             Array.Sort(memberInfos, objectData, this);
+                               MemberInfo[] memberInfos = 
FormatterServices.GetSerializableMembers(currentType, _context);
+                               object[] objectData = 
FormatterServices.GetObjectData(currentObject, memberInfos);
+                               
                                for(int i = 0; i < memberInfos.Length; i++) 
                                {
-                                       FieldInfo fieldInfo = memberInfos[i] as 
FieldInfo;
-//                                     bool specifyEncoding = false;
-//                                     if(objectData[i] != null)
-//                                              specifyEncoding = 
(objectData[i].GetType() != fieldInfo.FieldType);
-                                       
_xmlWriter.WriteStartElement(fieldInfo.Name);
+                                       FieldInfo fieldInfo = (FieldInfo) 
memberInfos[i];
+                                       SoapFieldAttribute at = 
(SoapFieldAttribute) InternalRemotingServices.GetCachedSoapAttribute 
(fieldInfo);
+                                       _xmlWriter.WriteStartElement 
(XmlConvert.EncodeLocalName (at.XmlElementName));
                                        SerializeComponent(
                                                objectData[i], 
                                                IsEncodingNeeded(objectData[i], 
fieldInfo.FieldType));

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to