cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: data binding question
Date Fri, 01 Feb 2008 03:27:02 GMT

Rob,

Writing a new databinding is slightly tricky to get completely working 
correctly.   I don't think we have any good docs for it yet.   The new 
xmlbeans databinding (on trunk only) is probably the easiest to follow 
as an example as it doesn't do anything that complex yet.

The steps to creating a databinding would be:

1) Write Reader/Writer implementations that read/write to 
XmlStreamReader/Writers.     In some cases, the runtime also wants 
readers/writers for nodes, but you can always create a 
XmlStreamReader/Writer  from the node and feed it into the same impl.   
JAXB does does some optimizations if it's a node, but for simplicity, 
the xmlbeans databinding currently doesn't.

2) Write the "DataBinding" object that creates the readers/writers.   
The tricky part of this is the initizialize(...) method.  It needs to 
create the schemas and get them plugged into the service model for all 
the parts so that the generated wsdl will look correct.    For XMLBeans, 
it was pretty simple as the schemas are in the generated jar.   For 
each "MessagePartInfo" just need to find the appropriate XmlSchema 
element or type and set the appropriate fields.

3) Fault handling - this is somewhat optional (xmlbeans doesn't do it 
yet), but if your databinding has special rules for handling/mapping 
exceptions, both of the above would need updating for that as well.  A 
chunk of jaxb's complexity is around that.

Anyway, I'd definitely recommend looking at the XmlBeans databinding.   
The JAXB databinding does a BUNCH of things that makes it very complex.   

Dan


On Wednesday 30 January 2008, Rob Barrett wrote:
> I'm about to start some data binding code to map soap messages to java
> components and I'm looking at the DataBinding interfaces in cxf.
>
> Could anyone point me at a good point of introduction to this
> interface/class set. I'd like to find out about the lifecycle of these
> things, how/when they are called, etc.
>
> Thanks, Rob



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Mime
View raw message