Just wanted to let you know that I found a solution to this.   :-)

See:
https://jaxb.dev.java.net/2.1.2/docs/vendorCustomizations.html#simple

Unfortunately, once you try that with CXF, you hit:
https://issues.apache.org/jira/browse/CXF-1620
unless you embedd the jaxb:globalBindings thing directly into the wsdl itself rather than an external bindings file.

I have a fix for that that I'm testing now.

Unfortunately, the produced class is kind of ugly. You just get a "List<Serializable>" which I'm not exactly sure of it's contents. Maybe JAXBElement objects? Don't really know. It at least doesn't barf. :-)


Dan



On Jul 10, 2008, at 4:15 PM, Daniel Kulp wrote:


Just dug through the jaxb spec and I'm not seeing anything obvious. If the jaxb folks couldn't help, I'm not sure who would be able to help. :-(

I'm pretty sure the work the SXC folks are doing (sxc.codehaus.org) runs after the processing of the schema so that doesn't really help. Not sure what to say.

Dan


On Jul 9, 2008, at 5:17 PM, [EMAIL PROTECTED] wrote:


Hello,

i don't have answer from JAXB mailing list, and i cannot find a clean solution. Maybe some here knows.

Problem:

i'm, using jaxb2.1.6 and i cannot find a solution for mapping of one situation (see attached XSD). Without customization xjc generates only list of jaxbElements. With customization i have 3 or maybe 4 different errors depending on how do i try to map elements to property names.

I also found this 
http://www.nabble.com/jaxb2---duplicate-element--issue-td16429810.html

Does someone know how to map it? Atm. it's not important, if "the same elements" in various branches of choice are mapped to the same property or to different properties. But to have the same element (name+type) mapped to one property is prefered way.

Error message depends also on fact, if i'm trying to map the elements with the same name+type to the same property name or not.
Some of errrors:
com.sun.istack.SAXParseException2: Element "{http://x.y.z}b"; shows up in more than one properties. com.sun.istack.SAXParseException2: compiler was unable to honor this property customization. It is attached to a wrong place, or its inconsistent with other bindings. (this one is from the same xsd as previous, i only changed customized property names to the same for the same element name+type) Other errors i had was about ambiguity and about property name collision.


thank you for sharing your idea/solution

best regards
jano




---
Daniel Kulp
[EMAIL PROTECTED]
http://www.dankulp.com/blog





---
Daniel Kulp
[EMAIL PROTECTED]
http://www.dankulp.com/blog




Reply via email to