Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 29941 invoked from network); 19 Dec 2009 20:06:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 Dec 2009 20:06:06 -0000 Received: (qmail 59593 invoked by uid 500); 19 Dec 2009 20:06:06 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 59512 invoked by uid 500); 19 Dec 2009 20:06:05 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 59502 invoked by uid 99); 19 Dec 2009 20:06:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Dec 2009 20:06:05 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [131.239.30.132] (HELO ntmamx2.progress.com) (131.239.30.132) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Dec 2009 20:05:57 +0000 Received: from ntmamx2.progress.com (127.0.0.1) by ntmamx2.progress.com (MlfMTA v3.2r9) id h5kp220171s2 for ; Sat, 19 Dec 2009 15:05:27 -0500 (envelope-from ) Received: from progress.com ([172.16.3.168]) by ntmamx2.progress.com (SonicWALL 7.1.1.1995) with ESMTP; Sat, 19 Dec 2009 15:05:27 -0500 Received: from NTEXFE01.bedford.progress.com (ntexfe01 [10.128.10.24]) by progress.com (8.13.8/8.13.8) with ESMTP id nBJK5V0x005614 for ; Sat, 19 Dec 2009 15:05:31 -0500 (EST) Received: from MAIL02.bedford.progress.com ([172.16.2.58]) by NTEXFE01.bedford.progress.com with Microsoft SMTPSVC(6.0.3790.3959); Sat, 19 Dec 2009 15:05:31 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: serializing subclass of base class gets base class name in output Date: Sat, 19 Dec 2009 15:05:29 -0500 Message-ID: In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: serializing subclass of base class gets base class name in output Thread-Index: AcqA5GddptGlPwXUShKFkQt1wk/JNwAAfpcg From: "Sergey Beryozkin" To: X-OriginalArrivalTime: 19 Dec 2009 20:05:31.0229 (UTC) FILETIME=[9DD4E8D0:01CA80E6] X-Mlf-Version: 7.1.1.1995 X-Mlf-UniqueId: o200912192005270455750 X-Virus-Checked: Checked by ClamAV on apache.org Hi You may want to try @XmlElements listing Bar.class and Gork.class instead of @XmlElement(name =3D "foo"), let us know please if it helps Cheers, Sergey. -----Original Message----- From: KARR, DAVID (ATTCINW) [mailto:dk068x@att.com]=20 Sent: 19 December 2009 19:50 To: users@cxf.apache.org Subject: serializing subclass of base class gets base class name in output I had originally had a "Foo" class in my REST server which was serializing fine as "". I then realized that this was really a base class, so I added the subclasses of it, which are "Bar" and "Gork". The declaration of the list of these is the following: @XmlElementWrapper(name =3D "childFoos") @XmlElement(name =3D "foo") private List childFoos; When I serialize this, I get exactly what I specified here, such that each "Foo" element is a "foo". What I want is to have a "" list, but each element will either be "" or "", depending on the subclass. The data I have in each "foo" is correct, reflecting whether it was a "bar" or a "gork", but I want the wrapper to change based on that. I tried to remove the "XmlElement" wrapper here, but that just resulted in "" wrapping a list of "", not a mixture of "" or "" elements.