Add failing Uri test
[mono.git] / mcs / tools / wsdl / MonoWSDL2.cs
index 35c4454fde408610059d82c59fd05947c24833d1..71eaf7ae68bafc3707c8b0851ceb4939f970670b 100644 (file)
@@ -127,9 +127,11 @@ namespace Mono.WebServices
                                codeUnit.Namespaces.Add (proxyCode);\r
                                \r
                                WebReferenceCollection references = new WebReferenceCollection ();\r
+\r
+                               DiscoveryClientProtocol dcc = CreateClient ();\r
+\r
                                foreach (string murl in urls) \r
                                {\r
-                                       DiscoveryClientProtocol dcc = CreateClient ();\r
 \r
                                        string url = murl;\r
                                        if (!url.StartsWith ("http://") && !url.StartsWith ("https://") && !url.StartsWith ("file://"))\r
@@ -138,13 +140,14 @@ namespace Mono.WebServices
                                        dcc.DiscoverAny (url);\r
                                        dcc.ResolveAll ();\r
                                        \r
-                                       WebReference reference = new WebReference (dcc.Documents, proxyCode, protocol, appSettingURLKey, appSettingBaseURL);\r
-                                       references.Add (reference);\r
-                                       \r
-                                       if (sampleSoap != null)\r
-                                               ConsoleSampleGenerator.Generate (descriptions, schemas, sampleSoap, protocol);\r
                                }\r
                                \r
+                               WebReference reference = new WebReference (dcc.Documents, proxyCode, protocol, appSettingURLKey, appSettingBaseURL);\r
+                               references.Add (reference);\r
+                               \r
+                               if (sampleSoap != null)\r
+                                       ConsoleSampleGenerator.Generate (descriptions, schemas, sampleSoap, protocol);\r
+                               \r
                                if (sampleSoap != null)\r
                                        return 0;\r
                                        \r
@@ -174,14 +177,18 @@ namespace Mono.WebServices
                        CodeDomProvider provider = GetProvider();\r
                                \r
                        StringCollection validationWarnings;\r
-                       validationWarnings = ServiceDescriptionImporter.GenerateWebReferences (references, options, style, provider, codeUnit, verbose);\r
+                       WebReferenceOptions opts = new WebReferenceOptions ();\r
+                       opts.CodeGenerationOptions = options;\r
+                       opts.Style = style;\r
+                       opts.Verbose = verbose;\r
+                       validationWarnings = ServiceDescriptionImporter.GenerateWebReferences (references, provider, codeUnit, opts);\r
                        \r
                        for (int n=0; n<references.Count; n++)\r
                        {\r
                                WebReference wr  = references [n];\r
                                \r
                                BasicProfileViolationCollection violations = new BasicProfileViolationCollection ();\r
-                               if (!WebServicesInteroperability.CheckConformance (WsiClaims.BP10, wr, violations)) {\r
+                               if (String.Compare (protocol, "SOAP", StringComparison.OrdinalIgnoreCase) == 0 && !WebServicesInteroperability.CheckConformance (WsiProfiles.BasicProfile1_1, wr, violations)) {\r
                                        wr.Warnings |= ServiceDescriptionImportWarnings.WsiConformance;\r
                                }\r
                                \r
@@ -189,14 +196,14 @@ namespace Mono.WebServices
                                {\r
                                        if (!hasWarnings) {\r
                                                WriteText ("", 0, 0);\r
-                                               WriteText ("There where some warnings while generating the code:", 0, 0);\r
+                                               WriteText ("There were some warnings while generating the code:", 0, 0);\r
                                        }\r
                                        \r
                                        WriteText ("", 0, 0);\r
                                        WriteText (urls[n], 2, 2);\r
                                        \r
                                        if ((wr.Warnings & ServiceDescriptionImportWarnings.WsiConformance) > 0) {\r
-                                               WriteText ("- This web reference does not conform to WS-I Basic Profile v1.0", 4, 6); \r
+                                               WriteText ("- This web reference does not conform to WS-I Basic Profile v1.1", 4, 6); \r
                                                foreach (BasicProfileViolation vio in violations) {\r
                                                        WriteText (vio.NormativeStatement + ": " + vio.Details, 8, 8);\r
                                                        foreach (string ele in vio.Elements)\r