cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Chaffee" <>
Subject RE: Overriding JAXB annotations
Date Thu, 30 Dec 2010 23:48:49 GMT
That's good to know too.  :) 

Is this documented on the site by any chance?

-----Original Message-----
From: Sergey Beryozkin [] 
Sent: Thursday, December 30, 2010 2:06 AM
Subject: Re: Overriding JAXB annotations


Sorry if the original question was not JAX-RS related, but after reading
Jason's answer I thought the following might be relevant as well :
JAXBElementProvider has an outTransformElements and outDropElements
properties which may be used to configure the provider such that it
transforms or blocks/ignores certain elements/attributes that the JAXB
attempts to write. When the transformations are client-specific then a
custom provider can have a map of some client-related keys to
configured  JAXBElementProvider instances.

The current limitation of this feature is that if a complex element
containing other elements needs to be blocked then one needs to provide
the element names, ex, if an element "b" needs to be ignored  :

<b xmlns="someNs">

then the "outDropElements" will look like this :

may be it can be enhanced like this :


where '*' indicates that the children have to be blocked

Cheers, Sergey

On Wed, Dec 29, 2010 at 10:42 PM, Jason Chaffee <>

> I have solved this problem by using AOP. I created my own annotationb
> (@MyTransientAnnotation) and annotated the methods that I did not want
> exposed.  Then I use a request header or something to identify who is
> requesting the data and based on either Aspect returns null or returns
> the data.
> -----Original Message-----
> From: cj91 []
> Sent: Wednesday, December 29, 2010 7:34 AM
> To:
> Subject: Re: Overriding JAXB annotations
> Ron Wheeler wrote:
> >
> > Would it not be easier to build a web service for external clients
> that
> > just calls the full internal  web service?
> > This might also allow additional auditing or reporting.
> >
> That's exactly what i'm attempting to do. The extrenal webservice will
> have
> authentication, authorization and tracking built in, but the problem
> do
> you call the internal service and hide certain information?
> One way to is redefine all of the objects, and add @XMLTransient as
> mentioned... but we don't want to do copy/paste engineering... Just
> curious
> if anyone has faced a similar problem and what they did to solve it.
> --
> View this message in context:
> Sent from the cxf-user mailing list archive at

View raw message