Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5176

Aegis inheritance: inherited xml attributes appear twice

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.7.5
    • 2.6.10, 2.7.7
    • Aegis Databinding
    • None
    • Unknown

    Description

      Hi,

      This JIRA issue follows my post in user mailing list (as asked by Dan Kulp).

      The behavior of Aegis databinding between CXF 2.3.9 and 2.7.5 has somewhat changed regarding inheritance.

      Being

      • two classes, BaseType and ExtendedType (that extends BaseType), both declaring XML elements and attributes, both having a distinct namespace (base-type-ns, extended-type-ns) ).
      • A simple web service operation returning an instance of ExtendedType
      In CXF 2.3.9 In CXF 2.7.5
      In the generated XML Schema (from the WSDL), only one type (ExtendedType) is present, having attributes and elements of BaseType appearing therefore in extended-type-ns namespace In the generated XML Schema (from the WSDL), the two types appear. One being an extension of the other. Therefore, elements from BaseType are in the base-type-ns namespace
        In generated XML Schema, BaseType attributes are present twice: in the BaseType type definition but also in the ExtendedType definition. That generates invalid xml message, the same (unqualified) attribute being written twice...

      First "behavior change" (element from super type that have a different namespace now) has also been reported by others (cf this), but doesn't look like very problematic.
      I mean, the new behavior is somewhat logical and it is what anyone would expect.

      But, the wrong handling of base type attributes is more than annoying, as non invalid xml is generated...

      In order to help regarding the resolution of this issue, I have written:

      • A small standalone maven project illustrating the test case described above and emphasizing the difference between 2.3.9 and 2.7.5 version,
      • a patch (for 2.7.x-fixes branch) to "enrich" the existing aegis databing inheritance testcase so that the attributes appearing twice are detected,
      • a patch (for 2.7.x-fixes branch) with a proposed quick fix for this issue. (To be stricly reviewed)

      (I just need to find a way to attach them to this issue )

      Kind regards,
      Vincent

      Attachments

        1. fix-aegis-inheritance-issue.patch
          3 kB
          Vincent
        2. enrich-aegis-inheritance-test-case.patch
          2 kB
          Vincent
        3. cxf-aegis-inheritance-bug.zip
          16 kB
          Vincent

        Activity

          People

            dkulp Daniel Kulp
            vincentr42 Vincent
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: