Explorar o código

* HttpSimpleProtocolImporter.cs: Fix import of arrays of primitive types.

svn path=/trunk/mcs/; revision=34574
Lluis Sanchez %!s(int64=21) %!d(string=hai) anos
pai
achega
802e76ff67

+ 4 - 0
mcs/class/System.Web.Services/System.Web.Services.Description/ChangeLog

@@ -1,3 +1,7 @@
+2004-10-01  Lluis Sanchez Gual  <[email protected]>
+
+	* HttpSimpleProtocolImporter.cs: Fix import of arrays of primitive types.
+
 2004-09-13  Lluis Sanchez Gual  <[email protected]>
 
 	* ServiceDescriptionReflector.cs: Don't generate empty schemas.

+ 7 - 1
mcs/class/System.Web.Services/System.Web.Services.Description/HttpSimpleProtocolImporter.cs

@@ -169,8 +169,14 @@ namespace System.Web.Services.Description
 			
 			if (msg.Parts[0].Name == "Body" && msg.Parts[0].Element == XmlQualifiedName.Empty)
 				return xmlReflectionImporter.ImportTypeMapping (typeof(XmlNode));
-			else
+			else {
+				// This is a bit hacky. The issue is that types such as string[] are to be imported
+				// as such, not as ArrayOfString class. ImportTypeMapping will return a
+				// class if the type has not been imported as an array before, hence the
+				// call to ImportMembersMapping.
+				xmlImporter.ImportMembersMapping (new XmlQualifiedName[] {msg.Parts[0].Element});
 				return xmlImporter.ImportTypeMapping (msg.Parts[0].Element);
+			}
 		}
 		
 		CodeMemberMethod GenerateMethod (CodeIdentifiers memberIds, HttpOperationBinding httpOper, XmlMembersMapping inputMembers, XmlTypeMapping outputMember)