Vincent created CXF-5176:
----------------------------
Summary: Aegis inheritance: inherited xml attributes appear twice
Key: CXF-5176
URL: https://issues.apache.org/jira/browse/CXF-5176
Project: CXF
Issue Type: Bug
Components: Aegis Databinding
Affects Versions: 2.7.5
Reporter: Vincent
Hi,
This JIRA issue follows [my
post|http://cxf.547215.n5.nabble.com/Aegis-and-inheritance-issue-migrating-from-2-3-9-to-2-7-5-tt5731622.html]
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|http://cxf.547215.n5.nabble.com/Aegis-and-inheritance-issue-migrating-from-2-3-9-to-2-7-5-td5731622.html]),
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
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira