Multi-schema fix needed for Test Analyzer V1 Java (Follow-up to WSBRSP-1)

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major
    • None
    • Hide

      Need to update wsdlCache.SchemaCache.ValidateSchema so that it looks at all types that match the namespace , not just the first one.
      It requires implementing an additional version of GetSchemaDocument(), that takes an integer "nth" meaning to take the nth occurrence of schema with same namespace, if any:
      public XmlDocumentSchema GetSchemaDocument(XmlNode referenceNode, bool includeErrorDocs, int nth)

      Show
      Need to update wsdlCache.SchemaCache.ValidateSchema so that it looks at all types that match the namespace , not just the first one. It requires implementing an additional version of GetSchemaDocument(), that takes an integer "nth" meaning to take the nth occurrence of schema with same namespace, if any: public XmlDocumentSchema GetSchemaDocument(XmlNode referenceNode, bool includeErrorDocs, int nth)

      See WSBRSP-1 issue for initial description.
      Here is a more detailed investigation:

      The failure of TA BP2122 is generated under this code (though deeper, can't see the actual exception text):
      wsdlCache.SchemaCache.ValidateSchema(schemaDoc, true);
      in:
      public class BP2122
      in:
      D:\...\WS-I-CVS\test-tools\cs\src\WSITest-Assertions\WsdlAssertions.cs

      The collection of schema elements from WSDL seems to be done correctly (does not assume they each have a unique namespace.)
      In:
      InnerList.Add(schema);
      In:
      SchemaCache.GetWsdlSchemaDocuments()
      In:
      D:\...\WS-I-CVS\test-tools\cs\src\WSITest-AnalyzerCore\Collections.cs

      But In SchemaCache.cs, there is reliance on namespace uniqueness, when validating against a schema:

      public XmlDocumentSchema GetSchemaDocument(XmlNode referenceNode, bool includeErrorDocs)

      especially clearly only returns the first schema that matches namespace in:

      public XmlDocumentSchema GetSchemaDocumentByNamespace(string targetNamespace, bool includeErrorDocs)

      So:
      wsdlCache.SchemaCache.ValidateSchema(schemaDoc, true);
      In:
      WsdlAssertions.cs
      IS not finding the right schema, always validating against the first namespace match...

      I suspect it might actually be easier to do the real fix: keep iterating until the right schema matching same namespace is found (if any) and validates successfully. Maybe Gerwin could do the fix...
      It could require implementing an additional version of GetSchemaDocument(), that takes an integer "nth" meaning to take the nth occurrence of schema with same namespace, if any:
      public XmlDocumentSchema GetSchemaDocument(XmlNode referenceNode, bool includeErrorDocs, int nth)

            Assignee:
            Unassigned
            Reporter:
            Jacques Durand (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: