I've encountered some strange behavior with CXF's stubs, and I'd like to
know if I should submit a tracker to capture this.

 

My application's WSDL has attribute properties which extend
"xsd:nmtokens". When generating Java stubs from the WSDL, CXF converts
these into List<String> properties. The getters are defined like this:

 

        public List<String> getDisCon () {

            if (disCon == null) {

                disCon = new ArrayList<String>();

            }

            return this.disCon;

        }

 

If the disCon field is null, CXF omits the attribute when converting the
property back into XML. However if the disCon field is an empty list,
CXF includes the attribute. Since the getDisCon method modifies the
disCon field when it's called, this means our code returns different XML
depending on whether or not we've called the getter. This behavior has
caused problems for my application, because I feed CXF's output through
an XSLT which gets confused if these fields are already populated.

 

- Aaron

Reply via email to