Author: lluis
Date: 2005-07-14 07:44:25 -0400 (Thu, 14 Jul 2005)
New Revision: 47298
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/SoapTypeMapper.cs
Log:
2005-07-14 Lluis Sanchez Gual <[EMAIL PROTECTED]>
* SoapReader.cs: Fixed parsing of array dimensions. Patch by Roei Erez
for bug #75536.
* SoapTypeMapper.cs: When encoding the name of a type, if the type is
an array don't encode the array dimensions.
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-07-14 10:24:33 UTC (rev 47297)
+++
trunk/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/ChangeLog
2005-07-14 11:44:25 UTC (rev 47298)
@@ -1,3 +1,10 @@
+2005-07-14 Lluis Sanchez Gual <[EMAIL PROTECTED]>
+
+ * SoapReader.cs: Fixed parsing of array dimensions. Patch by Roei Erez
+ for bug #75536.
+ * SoapTypeMapper.cs: When encoding the name of a type, if the type is
+ an array don't encode the array dimensions.
+
2005-06-27 Lluis Sanchez Gual <[EMAIL PROTECTED]>
* SoapWriter.cs: Serialize TimeSpan values like MS.NET. Fix by Roei Erez
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-07-14 10:24:33 UTC (rev 47297)
+++
trunk/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapReader.cs
2005-07-14 11:44:25 UTC (rev 47298)
@@ -343,12 +343,15 @@
}
// Get the array properties
- string strArrayType = xmlReader["arrayType",
SoapTypeMapper.SoapEncodingNamespace];
- string[] arrayInfo =
strArrayType.Split(':','[',',',']');
- int numberOfDims = arrayInfo.Length - 3;
- int[] lengths = new int[numberOfDims];
- string[] arrayDims = new String[numberOfDims];
- Array.Copy(arrayInfo, 2, arrayDims, 0, numberOfDims);
+ string strArrayType = xmlReader["arrayType",
SoapTypeMapper.SoapEncodingNamespace];
+ string[] arrayInfo = strArrayType.Split(':');
+ int arraySuffixInfo = arrayInfo[1].LastIndexOf('[');
+ String arrayElementType = arrayInfo[1].Substring(0,
arraySuffixInfo);
+ String arraySuffix =
arrayInfo[1].Substring(arraySuffixInfo);
+ string[] arrayDims =
arraySuffix.Substring(1,arraySuffix.Length-2).Trim().Split(',');
+ int numberOfDims = arrayDims.Length;
+ int[] lengths = new int[numberOfDims];
+
for (int i=0; i < numberOfDims; i++)
{
lengths[i] = Convert.ToInt32(arrayDims[i]);
@@ -357,10 +360,10 @@
int[] indices = new int[numberOfDims];
// Create the array
- Type arrayType = mapper[new Element(arrayInfo[0],
arrayInfo[1], xmlReader.LookupNamespace(arrayInfo[0]))];
+ Type arrayType = mapper[new Element(arrayInfo[0],
arrayElementType, xmlReader.LookupNamespace(arrayInfo[0]))];
Array array = Array.CreateInstance(
arrayType,
- lengths);
+ lengths);
for(int i = 0; i < numberOfDims; i++)
{
Modified:
trunk/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs
===================================================================
---
trunk/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs
2005-07-14 10:24:33 UTC (rev 47297)
+++
trunk/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs
2005-07-14 11:44:25 UTC (rev 47298)
@@ -251,9 +251,14 @@
namespaceToPrefixTable[namespaceURI] = prefix;
}
+ int i = typeName.IndexOf ("[");
+ if (i != -1)
+ typeName =
XmlConvert.EncodeName (typeName.Substring (0, i)) + typeName.Substring (i);
+ else
+ typeName =
XmlConvert.EncodeName (typeName);
element = new Element(
prefix,
-
XmlConvert.EncodeName(typeName),
+ typeName,
namespaceURI);
}
return element;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches