Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 78287 invoked from network); 5 Aug 2009 15:32:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Aug 2009 15:32:59 -0000 Received: (qmail 62288 invoked by uid 500); 5 Aug 2009 15:33:05 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 62227 invoked by uid 500); 5 Aug 2009 15:33: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 62217 invoked by uid 99); 5 Aug 2009 15:33:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Aug 2009 15:33:05 +0000 X-ASF-Spam-Status: No, hits=1.8 required=10.0 tests=MIME_QP_LONG_LINE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of Scott.Oster@osumc.edu designates 140.254.120.27 as permitted sender) Received: from [140.254.120.27] (HELO TWAPP-VP01.OSUMC.EDU) (140.254.120.27) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Aug 2009 15:32:55 +0000 Received: from [10.127.16.143] by TWAPP-VP01.OSUMC.EDU with ESMTP (OSUMC **** SMTP Relay ****); Wed, 05 Aug 2009 11:32:27 -0400 X-Server-Uuid: B9562FAF-5C56-437C-B754-33221F224476 Received: from localhost (unknown [127.0.0.1]) by pfeg01.osumc.edu ( Postfix) with ESMTP id 454D44B5C1 for ; Wed, 5 Aug 2009 15:32:27 +0000 (UTC) Received: from pfeg01.osumc.edu ([127.0.0.1]) by localhost ( pfeg01.osumc.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 02641-01-90 for ; Wed, 5 Aug 2009 11:32:27 -0400 (EDT) Received: from msxc01.OSUMC.EDU (msxc01.osumc.edu [10.127.29.33]) by pfeg01.osumc.edu (Postfix) with ESMTP id 1C42C4B5BF for ; Wed, 5 Aug 2009 11:32:27 -0400 (EDT) Received: from msxc06.OSUMC.EDU ([10.127.23.21]) by msxc01.OSUMC.EDU with Microsoft SMTPSVC(6.0.3790.1830); Wed, 5 Aug 2009 11:32:26 -0400 Received: from 10.81.127.5 ([10.81.127.5]) by msxc06.OSUMC.EDU ( [10.127.23.21]) via Exchange Front-End Server webmail.osumc.edu ( [10.127.23.215]) with Microsoft Exchange Server HTTP-DAV ; Wed, 5 Aug 2009 15:32:27 +0000 User-Agent: Microsoft-Entourage/12.19.0.090515 Date: Wed, 05 Aug 2009 11:32:19 -0400 Subject: Re: Re: @XmlRootElement with jax-rs/jax-ws From: "Scott Oster" To: users@cxf.apache.org Message-ID: Thread-Topic: @XmlRootElement with jax-rs/jax-ws Thread-Index: AcoV4esfsvEPUOWHs0O/1vvhZcvYKg== In-Reply-To: <1249461630.38931.ezmlm@cxf.apache.org> MIME-Version: 1.0 X-OriginalArrivalTime: 05 Aug 2009 15:32:26.0740 (UTC) FILETIME=[EFBC4B40:01CA15E1] X-Virus-Scanned: by amavisd-new at osumc.edu X-WSS-ID: 666779814002584673-01-01 Content-Type: text/plain; charset=euc-kr Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org >>AFAIK, in case of JAXWS, additional JAXB elements/classes are generated. Correct, though in the "wrapped" mapping, I don't believe these classes are used. In any event, I want the REST interface to return the XML of the "Book" not the "getBookResponse". Scott ----------------------------------------------- From: Sergey Beryozkin Date: Wed, 5 Aug 2009 01:39:59 -0700 (PDT) To: Subject: Re: @XmlRootElement with jax-rs/jax-ws Hi, AFAIK, in case of JAXWS, additional JAXB elements/classes are generated. Fo= r ex, if it's a method called 'getBook' returning Book then it will be a getBookResponse class that will be generated. I was also assuming that if ObjectFactory had methods returning JAXBElement= s then there'd be no need in updating the generated classes with @XmlRootElement which apparently is not the case. I don't think that in case of JAX-RS we can generate wrappers too. Dan - is there anything that can be done at a pure JAXB level for users to avoid explicitly adding XMLRootElement ? It appears there's no solution really... thanks, Sergey =20 Scott Oster-2 wrote: >=20 > I am trying to add jax-rs annotations to an existing service > implementation > generated by wsdltojava (wrapped style). The POJO returned by my > operation > is defined in a standalone XSD, and understandably doesn=A9=F6t have the > @XmlRootElement annotation (for the reasons described here > http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html= ). >=20 > My web service works fine, but my REST call dies with the error: > unable to marshal type "..." as an element because it is missing an > @XmlRootElement annotation >=20 > If I add the @XmlRootElement annotation to the POJO, it works fine, but > from > the documentation it seems I shouldn=A9=F6t have to do this (and I don=A9=F6t wan= t > to, > as it is generated code). >=20 > In reading this bug: http://issues.apache.org/jira/browse/CXF-1650 > It appears this was an issue and should be =A9=F8fixed=A9=F7 in the version I am > using > (2.2 and trunk) but it=A9=F6s not clear if I am expected to configure > something. >=20 > The documentation here: > http://cwiki.apache.org/CXF20DOC/jax-rs.html#JAX-RS-JAXBsupport states: > =A9=F8Alternatively to using @XmlRootElement and Collection wrappers, one can > provide an Object factory which will tell JAXB how to > marshal a given type (in case of Collections - its template type).=A9=F7 >=20 > I have an ObjectFactory, generated by wsdl2java (and it looks correct), > but > I=A9=F6m not sure how I am supposed to =A9=F8provide=A9=F7 it other than have it on t= he > classpath (as I do). Could you expand upon what exactly one needs to do > to > get this to work? >=20 > Thanks, > Scott