Return-Path: Received: from rgmum107.us.oracle.com by rgmum105.us.oracle.com with ESMTP id 9427804491143044904; Wed, 22 Mar 2006 09:28:24 -0700 Received: from rgmgw1.us.oracle.com by rgmum108.us.oracle.com with ESMTP id 4436668581143044002; Wed, 22 Mar 2006 09:13:22 -0700 Received: from rgmgw1.us.oracle.com (localhost [127.0.0.1]) by rgmgw1.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id k2MGDMXh002087 for ; Wed, 22 Mar 2006 09:13:22 -0700 Received: from rgminet04.oracle.com (rgminet04.oracle.com [148.87.113.121]) by rgmgw1.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id k2MGDMem002081 for ; Wed, 22 Mar 2006 09:13:22 -0700 Received: from dev.java.net (s006.sfo.collab.net [64.125.133.206]) by rgminet04.oracle.com (Switch-3.1.6/Switch-3.1.6) with SMTP id k2MGDKxH007670 for ; Wed, 22 Mar 2006 09:13:20 -0700 Received: (qmail 17298 invoked by uid 5000); 22 Mar 2006 16:13:19 -0000 Mailing-List: contact users-help@jaxb.dev.java.net; run by ezmlm Precedence: bulk X-No-Archive: yes list-help: list-unsubscribe: list-post: Reply-To: users@jaxb.dev.java.net Delivered-To: mailing list users@jaxb.dev.java.net Received: (qmail 17278 invoked from network); 22 Mar 2006 16:13:18 -0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AQAAAJEGIUSDE4R1AgILFzc X-IronPort-AV: i="4.03,119,1141632000"; d="scan'208,217"; a="8244337:sNHT32971988" X-IRONPORT: SCANNED X-GATEWAY: QinetiQ Message-ID: <4B399B8DBA86D411BB3500508B9566FF13344BC6@mal-mail-1.dera.gov.uk> From: Beech Tanya To: "'users@jaxb.dev.java.net'" Date: Wed, 22 Mar 2006 16:13:12 -0000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2656.59) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C64DCB.13100B5A" X-GATEWAY: Unclassified Subject: RE: using JAXB and AXIS2 version 0.94 ------_=_NextPart_001_01C64DCB.13100B5A Content-Type: text/plain 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@QinetiQ.com Mobile: 07766 134364 Web: www.QinetiQ.com QinetiQ - The Global Defence and Security Experts _____ From: Ian Carr [mailto:ian.carr@focus-solutions.co.uk] Sent: 22 March 2006 15:59 To: users@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 getTwo() { if (two == null) { two = new ArrayList(); } return this.two; } If I create and marshal an instance of the class it produces the expected output: However if the accessor is invoked before marshalling it produces the following output, with an empty 'two' attribute: 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* of IDREFS is the set of finite, non-zero-length sequences of 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. ------_=_NextPart_001_01C64DCB.13100B5A Content-Type: text/html Content-Transfer-Encoding: quoted-printable

Hi

 

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

 

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

 

Any help would be appreciated.<= /o:p>

 

Regards Tanya

 

Tanya Beech
Signal Processing

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

= =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20
=20

Tel: =20

=20

01684 895232

=20
=20

Email: <= /p> =20

=20

tbeech@QinetiQ.com

=20
=20

Mobile: =

=20
=20

07766 134364

=20
=20

Web: =20

=20

QinetiQ - The Global Defence and Security Experts


From: Ian Carr [mailto:ian.carr@focus-solutions.co.uk]
Sent: 22 March 2006 15:59<= br> To: users@jaxb.dev.java.ne= t
Subject: Optional List bas= ed attributes and marshalling

 

I have a query about the way JAXB is marshalling an op= tional list based attribute.

 

My schema contains an optional attribute of type xs:ID= REFS, using the EA3 build of JAXB 2 (jaxb-ri-20051223) I get the generated clas= ses I would expect with this attribute being given an accessor with the followi= ng signature:

 

public List<Object> getTwo() {=

if (two =3D=3D null) {<= /o:p>

two =3D n= ew ArrayList<Object>();

}

return this.two;<= /span>

}

 

If I create and marshal an instance of the class it pr= oduces the expected output:

 

<X/>

 

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

 

<X two=3D""/>

 

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

 

"The *value space*<= /a> of IDREFS is the set of finite, non-zero-length sequences of IDREFs"<= /span>

 

Which if I am reading it correctly means that a zero-l= ength 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 a= nd any=20 subsequent
correspondence is private and is intended solely for the=20 intended
recipient(s).  The information in this communication may= =20be=20 confidential
and/or legally privileged.  Nothing in this e-mail i= s=20 intended to
conclude a contract on behalf of QinetiQ or make QinetiQ s= ubject=20 to any
other legally binding commitments, unless the e-mail contains a= n=20 express
statement to the contrary or incorporates a formal Purchase=20 Order.

For those other than the recipient any dis= closure,=20 copying,
distribution, or any action taken or omitted to be taken in r= eliance=20 on
such information is prohibited and may be unlawful.

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

Telephone calls to QinetiQ may be monitore= d or=20 recorded for quality
control, security and other business=20 purposes.

------_=_NextPart_001_01C64DCB.13100B5A--