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

Aegis DataBinding ignores JAXB annotations on a field

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.18, 3.1.9, 3.0.12
    • Fix Version/s: 3.2.0
    • Component/s: Aegis Databinding
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      I've been trying to use CXF with Aegis DataBinding to host a web service that needs to be called by a 3rd party, using 3rd party's XML schema.

      It turns out that 3rd party XML schema has a naming convention that element names start with upper case. wsdl2java correctly placed JAXB XMLElement annotations on the fields in the generated POJOs, But at run-time, Aegis DataBinding ignores these JAXB annotations on the fields, which causes the XML from 3rd party to be ignored, instead of converted to the generated POJOs.

      I've identified the culprit to be org.apache.cxf.aegist.type.AnnotatedTypeInfo class, whose method createQName only looks for annotations on the getter methods, but ignores annotations on fields.

      I can see that this defect stems from the attempt to support both Aegis and JAXB annotations: former expect annotations on the getter methods, but latter however, even though quite similar, expect annotations on the field.

        Attachments

        1. CXF-7186.patch
          8 kB
          Sanjin Tulac
        2. CXF Aegis Data Binding.png
          72 kB
          Sanjin Tulac

          Issue Links

            Activity

              People

              • Assignee:
                dkulp Daniel Kulp
                Reporter:
                stulac Sanjin Tulac
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: