Hi On Thu, Dec 30, 2010 at 11:48 PM, Jason Chaffee <[email protected]> wrote:
> That's good to know too. :) > > Is this documented on the site by any chance? > > It's been there for a long time but I've just moved the relevant sub section to a higher-level one and also converted the examples to use a more readable XML format [1] https://cwiki.apache.org/confluence/display/CXF20DOC/JAX-RS+Data+Bindings#JAX-RSDataBindings-CustomizingJAXBXMLandJSONinputandoutput cheers, Sergey > -----Original Message----- > From: Sergey Beryozkin [mailto:[email protected]] > Sent: Thursday, December 30, 2010 2:06 AM > To: [email protected] > Subject: Re: Overriding JAXB annotations > > 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-t > p3320779p33%0A21436.html<http://cxf.547215.n5.nabble.com/Overriding-JAXB-annotations-t%0Ap3320779p33%0A21436.html> > > > > Sent from the cxf-user mailing list archive at Nabble.com. > > >
