users@jaxb.java.net

RE: using JAXB and AXIS2 version 0.94

From: Beech Tanya <TBEECH_at_qinetiq.com>
Date: Wed, 22 Mar 2006 16:13:12 -0000

Hi

 

Does anyone has experience of taking an Axis2 AXIOM OMElement and
unmarshalling this into a JAXB generated object?

 

If so could you please explain how to do this. I have managed to take a
JAXB object and convert this to a OMElement but can't seem to get this to
work the other way.

 

Any help would be appreciated.

 

Regards Tanya

 

Tanya Beech
Signal Processing

QinetiQ
Bldg E Rm 103
Malvern Technology Centre
St. Andrews Road, Malvern
Worcestershire, WR14 3PS


Tel:

01684 895232


Email:

tbeech_at_QinetiQ.com


Mobile:

07766 134364


Web:

 <http://www.qinetiq.com> www.QinetiQ.com

QinetiQ - The Global Defence and Security Experts

  _____

From: Ian Carr [mailto:ian.carr_at_focus-solutions.co.uk]
Sent: 22 March 2006 15:59
To: users_at_jaxb.dev.java.net
Subject: Optional List based attributes and marshalling

 

I have a query about the way JAXB is marshalling an optional list based
attribute.

 

My schema contains an optional attribute of type xs:IDREFS, using the EA3
build of JAXB 2 (jaxb-ri-20051223) I get the generated classes I would
expect with this attribute being given an accessor with the following
signature:

 

public List<Object> getTwo() {

if (two == null) {

two = new ArrayList<Object>();

}

return this.two;

}

 

If I create and marshal an instance of the class it produces the expected
output:

 

<X/>

 

However if the accessor is invoked before marshalling it produces the
following output, with an empty 'two' attribute:

 

<X two=""/>

 

This isn't a major issue, but one of my validators then complains that the
empty IDREFS attribute is not legal. Looking at the XML schema spec it says:

 

"The *value space* <http://www.w3.org/TR/xmlschema-2/#dt-value-space> of
IDREFS is the set of finite, non-zero-length sequences of IDREF
<http://www.w3.org/TR/xmlschema-2/#IDREF> s"

 

Which if I am reading it correctly means that a zero-length or "" value is
incorrect.

 

Is there something I am not doing in my schema, custom binding script or
code that would suppress this empty attribute?

 

Ian Carr

 

 


The information contained in this E-Mail and any subsequent
correspondence is private and is intended solely for the intended
recipient(s). The information in this communication may be confidential
and/or legally privileged. Nothing in this e-mail is intended to
conclude a contract on behalf of QinetiQ or make QinetiQ subject to any
other legally binding commitments, unless the e-mail contains an express
statement to the contrary or incorporates a formal Purchase Order.

For those other than the recipient any disclosure, copying,
distribution, or any action taken or omitted to be taken in reliance on
such information is prohibited and may be unlawful.

Emails and other electronic communication with QinetiQ may be monitored
and recorded for business purposes including security, audit and
archival purposes. Any response to this email indicates consent to
this.

Telephone calls to QinetiQ may be monitored or recorded for quality
control, security and other business purposes.