You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Vincent (JIRA)" <ji...@apache.org> on 2013/08/04 21:35:48 UTC

[jira] [Updated] (CXF-5176) Aegis inheritance: inherited xml attributes appear twice

     [ https://issues.apache.org/jira/browse/CXF-5176?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vincent updated CXF-5176:
-------------------------

    Attachment: fix-aegis-inheritance-issue.patch
                enrich-aegis-inheritance-test-case.patch
                cxf-aegis-inheritance-bug.zip

Here we go for attached files:
- [^cxf-aegis-inheritance-bug.zip]: the standalone small maven project illustrating differences between 2.3.9 / 2.7.5 versions regarding inheritance. Please adapt the {{cxf.version}} property in project pom.
- [^enrich-aegis-inheritance-test-case.patch]:
the enrichment of the existing inheritance test case. Patch to be applied on {{cxf\branches\2.7.x-fixes\rt\databinding\aegis}} directory 
- [^fix-aegis-inheritance-issue.patch]: A fix proposal. It simply applies the same logic for attributes as the one used for elements (skip inherited properties, when writing object/schema of the extended object). Probably a bit naive but it seems to work :-). Patch to be applied on {{cxf\branches\2.7.x-fixes\rt\databinding\aegis}} directory

Kind regards,
Vincent
                
> 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
>         Attachments: cxf-aegis-inheritance-bug.zip, enrich-aegis-inheritance-test-case.patch, fix-aegis-inheritance-issue.patch
>
>
> 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