[Mono-bugs] [Bug 81880][Nor] New - TypeTranslator - converts byte[] to not an array type

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Jun 15 07:30:50 EDT 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by mdabek at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=81880

--- shadow/81880	2007-06-15 07:30:50.000000000 -0400
+++ shadow/81880.tmp.28599	2007-06-15 07:30:50.000000000 -0400
@@ -0,0 +1,47 @@
+Bug#: 81880
+Product: Mono: Class Libraries
+Version: unspecified
+OS: GNU/Linux [Other]
+OS Details: RedHat 4 update 4 64 bit, probably all of Linux systems
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.XML
+AssignedTo: atsushi at ximian.com                            
+ReportedBy: mdabek at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: TypeTranslator - converts byte[] to not an array type
+
+Steps to reproduce the problem:
+1. Define or use a wsdl file, which will contain a function with an
+argument of ArrayOfUnsignedByte type. 
+2. Use wsdl2 to generate C# code. The generated C# function should have a
+form similar to:
+Foo([System.Xml.Serialization.XmlArrayAttribute()]
+[System.Xml.Serialization.XmlArrayItemAttribute("Byte", IsNullable=false)]
+byte[] argument); 
+3. Try to invoke the function from the C# code. 
+
+Actual Results:
+The InvalidOperationException is returned, with the following message:
+"XmlArrayAttribute can be applied to members of array or collection type."
+
+Expected Results:
+Invocation should pass without any problem. 
+
+How often does this happen? 
+Always
+
+Additional Information:
+On Microsoft .NET 2.0 it works fine.
+The problem is in TypeTranslator.cs. nameCache hashtable contains an entry
+of byte[] and it defines the TypeData as an primitive. The solution for me
+was the following change:
+- nameCache.Add(typeof (byte[]), new TypeData (typeof(byte[]),
+"base64Binary", true);
++ nameCache.Add(typeof (byte[]), new TypeData (typeof(byte[]),
+"base64Binary", false);


More information about the mono-bugs mailing list