2
0
Эх сурвалжийг харах

* HttpSimpleProtocolImporter.cs: pass the web service class list to the xml
importers to make sure that no data classes are created with the same
name as the web service.
* ProtocolImporter.cs: Use port name as class name only if there is more
than one port using the same protocol. This fixes big #52742.

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

Lluis Sanchez 22 жил өмнө
parent
commit
e67e12a9bf

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

@@ -1,3 +1,11 @@
+2004-01-21  Lluis Sanchez Gual <[email protected]>
+
+	* HttpSimpleProtocolImporter.cs: pass the web service class list to the xml 
+	  importers to make sure that no data classes are created with the same
+	  name as the web service.
+	* ProtocolImporter.cs: Use port name as class name only if there is more
+	  than one port using the same protocol. This fixes big #52742.
+
 2004-01-19  Lluis Sanchez Gual <[email protected]>
 
 	* HttpSimpleProtocolReflector.cs, SoapProtocolReflector.cs: 

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

@@ -67,8 +67,8 @@ namespace System.Web.Services.Description
 
 		protected override void BeginNamespace ()
 		{
-			xmlImporter = new XmlSchemaImporter (Schemas);
-			soapImporter = new SoapSchemaImporter (Schemas);
+			xmlImporter = new XmlSchemaImporter (Schemas, ClassNames);
+			soapImporter = new SoapSchemaImporter (Schemas, ClassNames);
 			xmlExporter = new XmlCodeExporter (CodeNamespace, null);
 		}
 

+ 10 - 3
mcs/class/System.Web.Services/System.Web.Services.Description/ProtocolImporter.cs

@@ -163,6 +163,13 @@ namespace System.Web.Services.Description {
 				foreach (Service service in info.ServiceDescription.Services)
 				{
 					this.service = service;
+					int bindingCount = 0;
+					foreach (Port port in service.Ports)
+					{
+						binding = ServiceDescriptions.GetBinding (port.Binding);
+						if (IsBindingSupported ()) bindingCount ++;
+					}
+					
 					foreach (Port port in service.Ports)
 					{
 						this.iinfo = info;
@@ -171,7 +178,7 @@ namespace System.Web.Services.Description {
 						if (!IsBindingSupported ()) continue;
 						
 						found = true;
-						ImportPortBinding ();
+						ImportPortBinding (bindingCount > 1);
 					}
 				}
 			}
@@ -181,9 +188,9 @@ namespace System.Web.Services.Description {
 			return true;
 		}
 
-		void ImportPortBinding ()
+		void ImportPortBinding (bool multipleBindings)
 		{
-			if (service.Ports.Count > 1) className = port.Name;
+			if (multipleBindings) className = port.Name;
 			else className = service.Name;
 			
 			className = classNames.AddUnique (CodeIdentifier.MakeValid (className), port);