Hi
Sorry if the original question was not JAX-RS related, but after reading the
Jason's answer I thought the following might be relevant as well : JAX-RS
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 individually
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 all
the element names, ex, if an element "b" needs to be ignored :
<a>
<b xmlns="someNs">
<c/>
</b>
</a>
then the "outDropElements" will look like this :
<list>
<value>{someNs}b</value>
<value>{someNs}c</value>
</list>
may be it can be enhanced like this :
<list>
<value>{someNs}b*</value>
</list>
where '*' indicates that the children have to be blocked
Cheers, Sergey
On Wed, Dec 29, 2010 at 10:42 PM, Jason Chaffee <[email protected]> wrote:
> 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 [mailto:[email protected]]
> Sent: Wednesday, December 29, 2010 7:34 AM
> To: [email protected]
> 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 how
> do
> you call the internal service and hide certain information?
>
> One way to is redefine all of the objects, and add @XMLTransient as was
> 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:
> http://cxf.547215.n5.nabble.com/Overriding-JAXB-annotations-tp3320779p33
> 21436.html<http://cxf.547215.n5.nabble.com/Overriding-JAXB-annotations-tp3320779p33%0A21436.html>
> Sent from the cxf-user mailing list archive at Nabble.com.
>