Explorar o código

* HttpSimpleProtocolImporter.cs: Fixed case of generated methods to match
MS behavior. Always use import input parameters as System.String.
* ProtocolImporter.cs: Remove _x0020_ from type names.
* SoapProtocolImporter.cs: Fixed case of generated methods to match
MS behavior.

svn path=/trunk/mcs/; revision=28694

Lluis Sanchez %!s(int64=21) %!d(string=hai) anos
pai
achega
a11fa40df5

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

@@ -1,3 +1,11 @@
+2004-06-02  Lluis Sanchez Gual  <[email protected]>
+
+	* HttpSimpleProtocolImporter.cs: Fixed case of generated methods to match
+	  MS behavior. Always use import input parameters as System.String.
+	* ProtocolImporter.cs: Remove _x0020_ from type names.
+	* SoapProtocolImporter.cs: Fixed case of generated methods to match
+	  MS behavior.
+	
 2004-06-01  Gert Driesen <[email protected]>
 
 	* Binding.cs: removed extra XmlIgnore attribute on ServiceDescription

+ 11 - 3
mcs/class/System.Web.Services/System.Web.Services.Description/HttpSimpleProtocolImporter.cs

@@ -166,8 +166,8 @@ namespace System.Web.Services.Description
 			string messageName = memberIds.AddUnique(CodeIdentifier.MakeValid(Operation.Name),method);
 
 			method.Name = Operation.Name;
-			methodBegin.Name = memberIds.AddUnique(CodeIdentifier.MakeValid("Begin" + memberIds.MakeRightCase(Operation.Name)),method);
-			methodEnd.Name = memberIds.AddUnique(CodeIdentifier.MakeValid("End" + memberIds.MakeRightCase(Operation.Name)),method);
+			methodBegin.Name = memberIds.AddUnique(CodeIdentifier.MakeValid("Begin" + Operation.Name),method);
+			methodEnd.Name = memberIds.AddUnique(CodeIdentifier.MakeValid("End" + Operation.Name),method);
 
 			method.ReturnType = new CodeTypeReference (typeof(void));
 			methodEnd.ReturnType = new CodeTypeReference (typeof(void));
@@ -178,7 +178,15 @@ namespace System.Web.Services.Description
 
 			for (int n=0; n<inputMembers.Count; n++)
 			{
-				CodeParameterDeclarationExpression param = new CodeParameterDeclarationExpression (inputMembers[n].TypeFullName, inputMembers[n].MemberName);
+//				CodeParameterDeclarationExpression param = new CodeParameterDeclarationExpression (inputMembers[n].TypeFullName, inputMembers[n].MemberName);
+
+				// MS always use System.String for input parameters
+				string ptype = inputMembers[n].TypeFullName;
+				int i = ptype.IndexOf ('[');
+				if (i == -1) i = ptype.Length;
+				ptype = "System.String" + ptype.Substring (i);
+				CodeParameterDeclarationExpression param = new CodeParameterDeclarationExpression (ptype, inputMembers[n].MemberName);
+				
 				param.Direction = FieldDirection.In;
 				method.Parameters.Add (param);
 				methodBegin.Parameters.Add (param);

+ 1 - 0
mcs/class/System.Web.Services/System.Web.Services.Description/ProtocolImporter.cs

@@ -210,6 +210,7 @@ namespace System.Web.Services.Description {
 			else className = service.Name;
 			
 			className = classNames.AddUnique (CodeIdentifier.MakeValid (className), port);
+			className = className.Replace ("_x0020_", "");	// MS.NET seems to do this
 			
 			try
 			{

+ 2 - 2
mcs/class/System.Web.Services/System.Web.Services.Description/SoapProtocolImporter.cs

@@ -297,8 +297,8 @@ namespace System.Web.Services.Description {
 
 			method.Name = CodeIdentifier.MakeValid(Operation.Name);
 			if (method.Name == ClassName) method.Name += "1";
-			methodBegin.Name = memberIds.AddUnique(CodeIdentifier.MakeValid("Begin" + memberIds.MakeRightCase(method.Name)),method);
-			methodEnd.Name = memberIds.AddUnique(CodeIdentifier.MakeValid("End" + memberIds.MakeRightCase(method.Name)),method);
+			methodBegin.Name = memberIds.AddUnique(CodeIdentifier.MakeValid("Begin" + method.Name),method);
+			methodEnd.Name = memberIds.AddUnique(CodeIdentifier.MakeValid("End" + method.Name),method);
 
 			method.ReturnType = new CodeTypeReference (typeof(void));
 			methodEnd.ReturnType = new CodeTypeReference (typeof(void));