Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 33924 invoked from network); 10 Aug 2010 11:22:09 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 10 Aug 2010 11:22:09 -0000 Received: (qmail 66751 invoked by uid 500); 10 Aug 2010 11:22:08 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 66663 invoked by uid 500); 10 Aug 2010 11:22: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 66655 invoked by uid 99); 10 Aug 2010 11:22:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Aug 2010 11:22:04 +0000 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_NEUTRAL,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 216.139.236.158 is neither permitted nor denied by domain of sudheer.tech@gmail.com) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Aug 2010 11:21:59 +0000 Received: from sam.nabble.com ([192.168.236.26]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Oimtm-00056Y-Kw for users@cxf.apache.org; Tue, 10 Aug 2010 04:21:38 -0700 Date: Tue, 10 Aug 2010 04:21:38 -0700 (PDT) From: Sudheer-3 To: users@cxf.apache.org Message-ID: <1281439298630-2418721.post@n5.nabble.com> Subject: JAXB only converting the base class not the derived class MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit We have implemented RESTFul service using Apache CXF. Used JSON as the communication between our GWT client and RESTFul server. Our DTOs are having structure Similar to below. Every DTO should extend BaseDTO. @XmlRootElement(name = "BaseDTO") public class BaseDTO implements Serializable { private String UUID; public String getUUID() { return UUID; } public void setUUID(String UUID) { this.UUID = UUID; } } @XmlRootElement(name = "Agent") public class Agent extends BaseDTO { private String description; public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } } We have configured JSONProvider in spring-config.xml as below Methods from AgentService.java returns List and we put this in a common response format defined below and constructs response using Response (javax.ws.rs.core.Response.ok(UIServiceResponse)). @XmlRootElement(name = "UIServiceResponse") public class UIServiceResponse { private UIException exception; private List result; public UIException getException() { return exception; } public void setException(UIException exception) { this.exception = exception; } public List getResult() { return result; } public void setResult(List result) { this.result = result; } } The problem is, everything works fine if we include @XmlSeeAlso({Agent.class}) to UIServiceResponse. But when we remove we are asked to provide information about the return classes. This UIServiceResponse is used from multiple projects and having @XmlSeeAlso included for every DTO we create is difficult and not a good approach. Is there any approach that works without using @XmlSeeAlso and gets derived class data to client? Any help is really appreciated. Hope I did not confuse :) Thank you -- View this message in context: http://cxf.547215.n5.nabble.com/JAXB-only-converting-the-base-class-not-the-derived-class-tp2418721p2418721.html Sent from the cxf-user mailing list archive at Nabble.com.