Author: atsushi
Date: 2007-05-11 09:15:28 -0400 (Fri, 11 May 2007)
New Revision: 77240

Modified:
   trunk/mcs/class/System.Web.Services/System.Web.Services.Description/ChangeLog
   
trunk/mcs/class/System.Web.Services/System.Web.Services.Description/ProtocolImporter.cs
   
trunk/mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionImporter.cs
   
trunk/mcs/class/System.Web.Services/Test/System.Web.Services.Description/ChangeLog
   
trunk/mcs/class/System.Web.Services/Test/System.Web.Services.Description/ServiceDescriptionImporterTest.cs
Log:
2007-05-11  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * ProtocolImporter.cs, ServiceDescriptionImporter.cs : when there
          is no binding item for a supported protocol in a WSDL, skip such
          protocol and try next protocol, so that it can match HTTPGET-only
          WSDLs. Part of fix for #81457.

        * ServiceDescriptionImporterTest.cs : added ignored test for #81457.



Modified: 
trunk/mcs/class/System.Web.Services/System.Web.Services.Description/ChangeLog
===================================================================
--- 
trunk/mcs/class/System.Web.Services/System.Web.Services.Description/ChangeLog   
    2007-05-11 13:09:21 UTC (rev 77239)
+++ 
trunk/mcs/class/System.Web.Services/System.Web.Services.Description/ChangeLog   
    2007-05-11 13:15:28 UTC (rev 77240)
@@ -1,3 +1,10 @@
+2007-05-11  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * ProtocolImporter.cs, ServiceDescriptionImporter.cs : when there
+         is no binding item for a supported protocol in a WSDL, skip such
+         protocol and try next protocol, so that it can match HTTPGET-only
+         WSDLs. Part of fix for #81457.
+
 2007-05-08  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * HttpSimpleProtocolReflector.cs : ServerType -> LogicalTypeInfo.

Modified: 
trunk/mcs/class/System.Web.Services/System.Web.Services.Description/ProtocolImporter.cs
===================================================================
--- 
trunk/mcs/class/System.Web.Services/System.Web.Services.Description/ProtocolImporter.cs
     2007-05-11 13:09:21 UTC (rev 77239)
+++ 
trunk/mcs/class/System.Web.Services/System.Web.Services.Description/ProtocolImporter.cs
     2007-05-11 13:15:28 UTC (rev 77240)
@@ -258,7 +258,7 @@
                        EndNamespace ();
                        
                        if (!found) warnings = 
ServiceDescriptionImportWarnings.NoCodeGenerated;
-                       return true;
+                       return found;
                }
 
                void ImportPortBinding (bool multipleBindings)
@@ -790,13 +790,13 @@
                public void UnsupportedOperationBindingWarning (string text)
                {
                        warnings |= 
ServiceDescriptionImportWarnings.UnsupportedOperationsIgnored;
-                       AddGlobalComments ("WARNING: Could not generate 
operation " + OperationBinding.Name + ". " + text);
+                       AddGlobalComments ("WARNING: Could not generate 
operation binding " + OperationBinding.Name + ". " + text);
                }
 
                public void UnsupportedOperationWarning (string text)
                {
                        warnings |= 
ServiceDescriptionImportWarnings.UnsupportedOperationsIgnored;
-                       AddGlobalComments ("WARNING: Could not generate 
operation " + OperationBinding.Name + ". " + text);
+                       AddGlobalComments ("WARNING: Could not generate 
operation " + Operation.Name + ". " + text);
                }
 
                void AddGlobalComments (string comments)

Modified: 
trunk/mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionImporter.cs
===================================================================
--- 
trunk/mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionImporter.cs
   2007-05-11 13:09:21 UTC (rev 77239)
+++ 
trunk/mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionImporter.cs
   2007-05-11 13:15:28 UTC (rev 77240)
@@ -141,24 +141,13 @@
 
                public ServiceDescriptionImportWarnings Import (CodeNamespace 
codeNamespace, CodeCompileUnit codeCompileUnit)
                {
-                       ProtocolImporter importer = GetImporter ();
-                       
-                       if (!importer.Import (this, codeNamespace, importInfo))
-                               throw new Exception ("None of the supported 
bindings was found");
-                               
-                       return importer.Warnings;
-               }
-               
-               ProtocolImporter GetImporter ()
-               {
-                       ArrayList importers = GetSupportedImporters ();
-                       if (protocolName == null || protocolName == "") 
protocolName = "Soap";
-                       foreach (ProtocolImporter importer in importers) {
-                               if (importer.ProtocolName.ToUpper () == 
protocolName.ToUpper ())
-                                       return importer;
+                       foreach (ProtocolImporter importer in 
GetSupportedImporters ()) {
+                               if ((protocolName != null && 
protocolName.Length != 0) && String.Compare (importer.ProtocolName, 
protocolName, true) != 0)
+                                       continue;
+                               if (importer.Import (this, codeNamespace, 
importInfo))
+                                       return importer.Warnings;
                        }
-                       
-                       throw new Exception ("Protocol " + protocolName + " not 
supported");
+                       throw new Exception ("None of the supported bindings 
was found");
                }
                
                ArrayList GetSupportedImporters ()

Modified: 
trunk/mcs/class/System.Web.Services/Test/System.Web.Services.Description/ChangeLog
===================================================================
--- 
trunk/mcs/class/System.Web.Services/Test/System.Web.Services.Description/ChangeLog
  2007-05-11 13:09:21 UTC (rev 77239)
+++ 
trunk/mcs/class/System.Web.Services/Test/System.Web.Services.Description/ChangeLog
  2007-05-11 13:15:28 UTC (rev 77240)
@@ -1,5 +1,9 @@
 2007-05-11  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
+       * ServiceDescriptionImporterTest.cs : added ignored test for #81457.
+
+2007-05-11  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
        * ServiceDescriptionReflectorTest.cs : added test for 78953 (not
          working, hard to fix) and 79807 (already fixed).
 

Modified: 
trunk/mcs/class/System.Web.Services/Test/System.Web.Services.Description/ServiceDescriptionImporterTest.cs
===================================================================
--- 
trunk/mcs/class/System.Web.Services/Test/System.Web.Services.Description/ServiceDescriptionImporterTest.cs
  2007-05-11 13:09:21 UTC (rev 77239)
+++ 
trunk/mcs/class/System.Web.Services/Test/System.Web.Services.Description/ServiceDescriptionImporterTest.cs
  2007-05-11 13:15:28 UTC (rev 77240)
@@ -93,6 +93,31 @@
                                new CodeCompileUnit (),
                                new WebReferenceOptions ());
                }
+
+               [Test]
+               [Ignore ("This test requires HttpGet available by 
configuration.")]
+               public void ImportHttpOnlyWsdl ()
+               {
+                       ServiceDescriptionImporter imp =
+                               new ServiceDescriptionImporter ();
+                       imp.AddServiceDescription (ServiceDescription.Read 
("Test/System.Web.Services.Description/test3.wsdl"), null, null);
+                       CodeNamespace cns = new CodeNamespace ();
+                       CodeCompileUnit ccu = new CodeCompileUnit ();
+                       ccu.Namespaces.Add (cns);
+                       imp.Import (cns, ccu);
+                       // FIXME: this test could require more precise result
+                       bool verified = false;
+                       Assert.AreEqual (1, ccu.Namespaces.Count, "#1");
+                       Assert.AreEqual (1, ccu.Namespaces [0].Types.Count, 
"#2");
+                       foreach (CodeTypeDeclaration cd in ccu.Namespaces 
[0].Types) {
+Console.WriteLine ("***" + cd.Name);
+                               if (cd.Name != "MyService")
+                                       continue;
+                               Assert.AreEqual 
("System.Web.Services.Protocols.HttpGetClientProtocol", cd.BaseTypes 
[0].BaseType);
+                               verified = true;
+                       }
+                       Assert.IsTrue (verified, "verified");
+               }
 #endif
        }
 }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to