* ProtocolReflector.cs: fixed ImportBinding method, ports with the same name declarat...
authorVladimir Krasnov <krasnov@mono-cvs.ximian.com>
Tue, 10 Jun 2008 11:50:43 +0000 (11:50 -0000)
committerVladimir Krasnov <krasnov@mono-cvs.ximian.com>
Tue, 10 Jun 2008 11:50:43 +0000 (11:50 -0000)
svn path=/trunk/mcs/; revision=105410

mcs/class/System.Web.Services/System.Web.Services.Description/ChangeLog
mcs/class/System.Web.Services/System.Web.Services.Description/ProtocolReflector.cs

index e62640cf2bf3f27bfaae7519c8cf19672ea21344..76bc8bac59fdc8dca374126c6b9f039a6bc801f5 100644 (file)
@@ -1,3 +1,8 @@
+2008-06-10  Vladimir Krasnov  <vladimirk@mainsoft.com>
+
+       * ProtocolReflector.cs: fixed ImportBinding method, ports with the same
+        name declaration when non-default binding used, #345449
+
 2008-04-01  Lluis Sanchez Gual <lluis@novell.com> 
 
        * ProtocolImporter.cs: Use the binding name as class name for the
index 1471c3498e5696ffe0ad908a1cb7d8a86095125b..9dadfe00ce289d60aaa0d3f41e9775b8f1ce1488 100644 (file)
@@ -278,6 +278,18 @@ namespace System.Web.Services.Description {
                        if (bindingFull)
                        {
                                port.Binding = new XmlQualifiedName (binding.Name, binfo.Namespace);
+                               
+                               int n = 0;
+                               string name = binfo.Name; 
+                               bool found;
+                               do {
+
+                                       found = false;
+                                       foreach (Port p in service.Ports)
+                                               if (p.Name == name) { found = true; n++; name = binfo.Name + n; break; }
+                               }
+                               while (found);
+                               port.Name = name;
                                service.Ports.Add (port);
                        }