diff options
author | Lluis Sanchez <lluis@novell.com> | 2005-09-21 15:26:52 +0400 |
---|---|---|
committer | Lluis Sanchez <lluis@novell.com> | 2005-09-21 15:26:52 +0400 |
commit | 36acb0b03ed7b3be15986791ff836a0fd354304b (patch) | |
tree | 6199c9028514e17619e84557cd63439384258823 /mcs/class/System.Runtime.Serialization.Formatters.Soap | |
parent | df1bf93a8142d560bf2ce64fd576bd1f5e2268fe (diff) |
2005-09-21 Lluis Sanchez Gual <lluis@novell.com>
* SoapWriter.cs, SoapReader.cs: Encode/Decode field names when
serializing/deserializing an object using custom serialization.
Fixes bug #75970.
svn path=/trunk/mcs/; revision=50367
Diffstat (limited to 'mcs/class/System.Runtime.Serialization.Formatters.Soap')
3 files changed, 10 insertions, 4 deletions
diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/ChangeLog b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/ChangeLog index 58eb1b1e6a9..e91dab4676f 100644 --- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/ChangeLog +++ b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/ChangeLog @@ -1,3 +1,9 @@ +2005-09-21 Lluis Sanchez Gual <lluis@novell.com> + + * SoapWriter.cs, SoapReader.cs: Encode/Decode field names when + serializing/deserializing an object using custom serialization. + Fixes bug #75970. + 2005-07-29 Lluis Sanchez Gual <lluis@novell.com> * SoapWriter.cs: Wrap method signature headers in a MethodSignature diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapReader.cs b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapReader.cs index 495191023ea..d0361746461 100644 --- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapReader.cs +++ b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapReader.cs @@ -591,7 +591,7 @@ namespace System.Runtime.Serialization.Formatters.Soap { while(xmlReader.Depth > initialDepth)
{
Type fieldType = GetComponentType();
- string fieldName = xmlReader.LocalName;
+ string fieldName = XmlConvert.DecodeName (xmlReader.LocalName);
object objField = DeserializeComponent(
fieldType,
out fieldId,
diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs index 42f3d28ff69..4a51b759ef4 100644 --- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs +++ b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs @@ -385,7 +385,7 @@ namespace System.Runtime.Serialization.Formatters.Soap { // with a id = 0
if(currentObjectId > 0)
{
- Element element = _mapper.GetXmlElement (currentType);
+ Element element = _mapper.GetXmlElement (currentType); _xmlWriter.WriteStartElement(element.Prefix, element.LocalName, element.NamespaceURI);
Id(currentObjectId);
} @@ -406,7 +406,7 @@ namespace System.Runtime.Serialization.Formatters.Soap { for(int i = 0; i < memberInfos.Length; i++)
{
FieldInfo fieldInfo = (FieldInfo) memberInfos[i];
- SoapFieldAttribute at = (SoapFieldAttribute) InternalRemotingServices.GetCachedSoapAttribute (fieldInfo);
+ SoapFieldAttribute at = (SoapFieldAttribute) InternalRemotingServices.GetCachedSoapAttribute (fieldInfo); _xmlWriter.WriteStartElement (XmlConvert.EncodeLocalName (at.XmlElementName));
SerializeComponent(
objectData[i],
@@ -445,7 +445,7 @@ namespace System.Runtime.Serialization.Formatters.Soap { foreach(SerializationEntry entry in info)
{
- _xmlWriter.WriteStartElement(entry.Name);
+ _xmlWriter.WriteStartElement(XmlConvert.EncodeLocalName (entry.Name));
SerializeComponent(entry.Value, IsEncodingNeeded(entry.Value, null));
_xmlWriter.WriteEndElement();
}
|