X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Ftools%2Fwsdl%2FMonoWSDL.cs;h=430b225329d1e6d533d9fd206a04752b82574306;hb=c47fab9285e660fe5078dc412294ece6358f886d;hp=073e338b8e989897218ba68d836c389ea1073492;hpb=a8b22e0e864c03b8cfd2f2cb5a8075b6611c5553;p=mono.git diff --git a/mcs/tools/wsdl/MonoWSDL.cs b/mcs/tools/wsdl/MonoWSDL.cs index 073e338b8e9..430b225329d 100644 --- a/mcs/tools/wsdl/MonoWSDL.cs +++ b/mcs/tools/wsdl/MonoWSDL.cs @@ -528,32 +528,31 @@ namespace Mono.WebServices return 0; } - if (className == null) - { - foreach (string urlEntry in urls) { - string url = urlEntry; + if (className == null) { DiscoveryClientProtocol dcc = CreateClient (); - dcc.AllowAutoRedirect = true; - if (!url.StartsWith ("http://") && !url.StartsWith ("https://") && !url.StartsWith ("file://")) - url = new Uri (Path.GetFullPath (url)).ToString (); - - dcc.DiscoverAny (url); - dcc.ResolveAll (); - - foreach (object doc in dcc.Documents.Values) - { + + foreach (string urlEntry in urls) { + string url = urlEntry; + dcc.AllowAutoRedirect = true; + if (!url.StartsWith ("http://") && !url.StartsWith ("https://") && !url.StartsWith ("file://")) + url = new Uri (Path.GetFullPath (url)).ToString (); + + dcc.DiscoverAny (url); + dcc.ResolveAll (); + } + + foreach (object doc in dcc.Documents.Values) { if (doc is ServiceDescription) - descriptions.Add ((ServiceDescription)doc); + descriptions.Add ((ServiceDescription) doc); else if (doc is XmlSchema) - schemas.Add ((XmlSchema)doc); + schemas.Add ((XmlSchema) doc); } - - if (descriptions.Count == 0) - throw new Exception ("No WSDL document was found at the url " + url); - } - } - else - { + + if (descriptions.Count == 0) { + Console.WriteLine ("Warning: no classes were generated."); + return 0; + } + } else { string[] names = className.Split (','); if (names.Length != 2) throw new Exception ("Invalid parameter value for 'type'"); string cls = names[0].Trim ();