I have attached an update to the databinding-jaxb-axiom test cases that
demonstrates the problem:
The test file in question is in
modules\databinding-jaxb-axiom\src\test\java\org\apache\tuscany\databind
ing\jaxb\axiom\OMElement2JAXBTestCase.java

Padraig


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of
Scott Kurz
Sent: 31 March 2011 20:37
To: [email protected]
Subject: Re: JaxB Unmarshaller not working properly for xsi:nil

Hi Padraig,


On Thu, Mar 31, 2011 at 1:38 PM, Padraig Myers
<[email protected]> wrote:

> It transforms each of the objects adding xsi:type if it is a complex
object,
> such that privacyList in the above example becomes:
>
> <privacyList
xmlns:_typens_="http://business.management.image.company.com/";
> xsi:nil="true" xsi:type="_typens_:privacyListDTO"></privacyList>


Just want to make sure I'm following.   It sounds like you're talking
about the path in which we unwrap-then-transform to JAXB, right?
I know in this path the OMElementWrapperHandler will add the xsi:type
to each wrapper child to facilitate the transform from OMElement child
to JAXB child.

Does that sound like what you are talking about?

If so, one thing worth considering is that you should be able to
bypass this path by using a schema-valid payload, if this is an option
for you.    With a schema-valid payload, we will typically do a
wrapper->wrapper transform from XML->JAXB, whereas with a non-valid
payload we will go down this child->child transform path.

If that's not relevant or if somehow the problem still exists, have
you looked at using  @XmlJavaTypeAdapter
to customize unmarshalling.   I don't have any particularly good doc
to point to, but there is some info out there on the subject, and
there's always the Java doc.

Hope that helps,
Scott

Attachment: OMElement2JAXBTestCase.java
Description: OMElement2JAXBTestCase.java

Reply via email to