New test.
[mono.git] / mcs / class / System.Web.Services / System.Web.Services.Description / ConformanceChecker.cs
index a65e4bae6052662d07aee6b03bd5a67960777e3c..a4a037aa75e8b400f465ef48a2de797de1fc44d8 100644 (file)
@@ -31,6 +31,7 @@
 #if NET_2_0
 
 using System.Xml.Schema;
+using System.Xml.Serialization;
 
 namespace System.Web.Services.Description 
 {
@@ -54,6 +55,7 @@ namespace System.Web.Services.Description
                public virtual void Check (ConformanceCheckContext ctx, ServiceDescriptionFormatExtension value) {}
                public virtual void Check (ConformanceCheckContext ctx, XmlSchemaObject value) {}
                
+               public virtual void Check (ConformanceCheckContext ctx, XmlSchema s) {}
                public virtual void Check (ConformanceCheckContext ctx, XmlSchemaImport value) {}
                public virtual void Check (ConformanceCheckContext ctx, XmlSchemaAll value) {}
                public virtual void Check (ConformanceCheckContext ctx, XmlSchemaAnnotation value) {}
@@ -104,6 +106,7 @@ namespace System.Web.Services.Description
                public ServiceDescription ServiceDescription;
                public XmlSchema CurrentSchema;
                XmlSchemas schemas = new XmlSchemas ();
+               ServiceDescriptionCollection services;
                
                public ConformanceCheckContext (ServiceDescriptionCollection collection, BasicProfileViolationCollection violations)
                {
@@ -111,23 +114,26 @@ namespace System.Web.Services.Description
                        this.violations = violations;
                        foreach (ServiceDescription sd in collection) {
                                if (sd.Types != null && sd.Types.Schemas != null)
-                                       schemas.Add (s.Types.Schemas);
+                                       schemas.Add (sd.Types.Schemas);
                        }
+                       services = collection;
                }
                
                public ConformanceCheckContext (WebReference webReference, BasicProfileViolationCollection violations)
                {
                        this.webReference = webReference;
                        this.violations = violations;
+                       services = new ServiceDescriptionCollection ();
                        
                        foreach (object doc in webReference.Documents.Values) 
                        {
                                if (doc is XmlSchema)
-                                       schemas.Add (doc);
+                                       schemas.Add ((XmlSchema)doc);
                                else if (doc is ServiceDescription) {
                                        ServiceDescription sd = (ServiceDescription) doc;
+                                       services.Add (sd);
                                        if (sd.Types != null && sd.Types.Schemas != null)
-                                               schemas.Add (s.Types.Schemas);
+                                               schemas.Add (sd.Types.Schemas);
                                }
                        }
                }
@@ -145,6 +151,10 @@ namespace System.Web.Services.Description
                        get { return schemas; }
                }
                
+               public ServiceDescriptionCollection Services {
+                       get { return services; }
+               }
+               
                public object GetDocument (string url)
                {
                        if (collection != null)