Merge pull request #1296 from directhex/master
[mono.git] / mcs / tools / wsdl / MonoWSDL.cs
index 073e338b8e989897218ba68d836c389ea1073492..430b225329d1e6d533d9fd206a04752b82574306 100644 (file)
@@ -528,32 +528,31 @@ namespace Mono.WebServices
                                        return 0;\r
                                }\r
                                \r
-                               if (className == null)\r
-                               {\r
-                               foreach (string urlEntry in urls) {\r
-                                       string url = urlEntry;\r
+                               if (className == null) {\r
                                        DiscoveryClientProtocol dcc = CreateClient ();\r
-                                       dcc.AllowAutoRedirect = true;\r
-                                       if (!url.StartsWith ("http://") && !url.StartsWith ("https://") && !url.StartsWith ("file://"))\r
-                                               url = new Uri (Path.GetFullPath (url)).ToString ();\r
-                                               \r
-                                       dcc.DiscoverAny (url);\r
-                                       dcc.ResolveAll ();\r
-                                       \r
-                                       foreach (object doc in dcc.Documents.Values)\r
-                                       {\r
+\r
+                                       foreach (string urlEntry in urls) {\r
+                                               string url = urlEntry;\r
+                                               dcc.AllowAutoRedirect = true;\r
+                                               if (!url.StartsWith ("http://") && !url.StartsWith ("https://") && !url.StartsWith ("file://"))\r
+                                                       url = new Uri (Path.GetFullPath (url)).ToString ();\r
+                                                       \r
+                                               dcc.DiscoverAny (url);\r
+                                               dcc.ResolveAll ();\r
+                                       }\r
+\r
+                                       foreach (object doc in dcc.Documents.Values) {\r
                                                if (doc is ServiceDescription)\r
-                                                       descriptions.Add ((ServiceDescription)doc);\r
+                                                       descriptions.Add ((ServiceDescription) doc);\r
                                                else if (doc is XmlSchema)\r
-                                                       schemas.Add ((XmlSchema)doc);\r
+                                                       schemas.Add ((XmlSchema) doc);\r
                                        }\r
-                                       \r
-                                       if (descriptions.Count == 0)\r
-                                               throw new Exception ("No WSDL document was found at the url " + url);\r
-                               }\r
-                               }\r
-                               else\r
-                               {\r
+\r
+                                       if (descriptions.Count == 0) {\r
+                                               Console.WriteLine ("Warning: no classes were generated.");\r
+                                               return 0;\r
+                                       }\r
+                               } else {\r
                                        string[] names = className.Split (',');\r
                                        if (names.Length != 2) throw new Exception ("Invalid parameter value for 'type'");\r
                                        string cls = names[0].Trim ();\r