You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "KARR, DAVID (ATTCINW)" <dk...@att.com> on 2009/09/11 22:55:55 UTC

How to have CXF work with external JAXB bindings file?

I'm trying to experiment with an external JAXB bindings file with CXF.
Will the specs in this be used at marshalling time to allow for
massaging of the output, or is this only intended to be used for code
generation?  If it can be used at marshalling time, where exactly do I
put it?  Do I have to indicate its presence in the CXF configuration
somehow?

RE: How to have CXF work with external JAXB bindings file?

Posted by "KARR, DAVID (ATTCINW)" <dk...@att.com>.
> -----Original Message-----
> From: Sergey Beryozkin [mailto:sergey.beryozkin@iona.com]
> 
> We've chatted with Dan on IRC about it... The external binding files
> can
> only be used for code-gen purposes. They can not be utilized during
the
> marshalling time. But there's always an option to register a custom
> XMLStreamWriter. Please let us know how you'd like the output be
> affected by
> an external JAXB bindings file - and I'll try to show how the same can
> be
> done by registering a sample writer.

At this point, I'm still in the prototyping stage, testing what limits
I'll have when I'm implementing real requirements.  I think it's likely
some modifications to both the XML and JSON output will be required, but
I just don't know what those requirements will be.

After a brief survey of the existing XMLStreamWriter subclasses in the
existing code base, I think that won't do much for me.  I think the
kinds of things I get from "@Xml..." annotations will be more
meaningful.  I haven't yet explored trying to define a physical schema
and binding elements from that to my objects.  That is a reasonably
likely scenario.

> KARR, DAVID (ATTCINW) wrote:
> >
> > I'm trying to experiment with an external JAXB bindings file with
> CXF.
> > Will the specs in this be used at marshalling time to allow for
> > massaging of the output, or is this only intended to be used for
code
> > generation?  If it can be used at marshalling time, where exactly do
> I
> > put it?  Do I have to indicate its presence in the CXF configuration
> > somehow?
> >
> >
> 
> --
> View this message in context: http://www.nabble.com/How-to-have-CXF-
> work-with-external-JAXB-bindings-file--tp25408207p25438466.html
> Sent from the cxf-user mailing list archive at Nabble.com.


RE: How to have CXF work with external JAXB bindings file?

Posted by "KARR, DAVID (ATTCINW)" <dk...@att.com>.
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Monday, September 14, 2009 9:08 AM
> To: users@cxf.apache.org
> Cc: Sergey Beryozkin
> Subject: Re: How to have CXF work with external JAXB bindings file?
> 
> 
> As Sergey said, the binding files are a code gen type thing.
> Basically, the
> binding files affect the annotations and such that are generated on
the
> generated .java files and those annotations then affect the runtime.
> 
> What types of things are you trying to control from the bindings file?
> Sometimes a custom XMLStreamWriter is appropriate.  Other times, there
> are
> properties that can be set on the marshaller and various event
> listeners and
> such that can be registered as well.

I'll have to research those available properties.  I have a feeling a
concise list of them is hard to find.

> On Mon September 14 2009 11:57:17 am Sergey Beryozkin wrote:
> > Hi
> >
> > We've chatted with Dan on IRC about it... The external binding files
> can
> > only be used for code-gen purposes. They can not be utilized during
> the
> > marshalling time. But there's always an option to register a custom
> > XMLStreamWriter. Please let us know how you'd like the output be
> affected
> >  by an external JAXB bindings file - and I'll try to show how the
> same can
> >  be done by registering a sample writer.
> >
> > cheers, Sergey
> >
> > KARR, DAVID (ATTCINW) wrote:
> > > I'm trying to experiment with an external JAXB bindings file with
> CXF.
> > > Will the specs in this be used at marshalling time to allow for
> > > massaging of the output, or is this only intended to be used for
> code
> > > generation?  If it can be used at marshalling time, where exactly
> do I
> > > put it?  Do I have to indicate its presence in the CXF
> configuration
> > > somehow?
> >
> 
> --
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog

Re: How to have CXF work with external JAXB bindings file?

Posted by Daniel Kulp <dk...@apache.org>.
As Sergey said, the binding files are a code gen type thing.  Basically, the 
binding files affect the annotations and such that are generated on the 
generated .java files and those annotations then affect the runtime.  

What types of things are you trying to control from the bindings file?   
Sometimes a custom XMLStreamWriter is appropriate.  Other times, there are 
properties that can be set on the marshaller and various event listeners and 
such that can be registered as well.  

Dan



On Mon September 14 2009 11:57:17 am Sergey Beryozkin wrote:
> Hi
> 
> We've chatted with Dan on IRC about it... The external binding files can
> only be used for code-gen purposes. They can not be utilized during the
> marshalling time. But there's always an option to register a custom
> XMLStreamWriter. Please let us know how you'd like the output be affected
>  by an external JAXB bindings file - and I'll try to show how the same can
>  be done by registering a sample writer.
> 
> cheers, Sergey
> 
> KARR, DAVID (ATTCINW) wrote:
> > I'm trying to experiment with an external JAXB bindings file with CXF.
> > Will the specs in this be used at marshalling time to allow for
> > massaging of the output, or is this only intended to be used for code
> > generation?  If it can be used at marshalling time, where exactly do I
> > put it?  Do I have to indicate its presence in the CXF configuration
> > somehow?
> 

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: How to have CXF work with external JAXB bindings file?

Posted by Sergey Beryozkin <se...@iona.com>.
Hi

We've chatted with Dan on IRC about it... The external binding files can
only be used for code-gen purposes. They can not be utilized during the
marshalling time. But there's always an option to register a custom
XMLStreamWriter. Please let us know how you'd like the output be affected by
an external JAXB bindings file - and I'll try to show how the same can be
done by registering a sample writer.

cheers, Sergey


KARR, DAVID (ATTCINW) wrote:
> 
> I'm trying to experiment with an external JAXB bindings file with CXF.
> Will the specs in this be used at marshalling time to allow for
> massaging of the output, or is this only intended to be used for code
> generation?  If it can be used at marshalling time, where exactly do I
> put it?  Do I have to indicate its presence in the CXF configuration
> somehow?
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-have-CXF-work-with-external-JAXB-bindings-file--tp25408207p25438466.html
Sent from the cxf-user mailing list archive at Nabble.com.