On Wednesday 21 July 2010 2:25:01 pm Dennis Sosnoski wrote:
> I've been looking at supplying the information needed by CXF from JiBX
> code generation, in particular that represented by the
> org.apache.cxf.tools.wsdlto.core.DataBindingProfile interface methods
> String getType(QName qn, boolean element) and String
> getWrappedElementType(QName wrapperElement, QName item).
> 
> I figure these are used to handle adding data to a wrapper bean on the
> client side, and extracting data from a wrapper bean on the service
> side.

Well, no.  It's ONLY used for code generation.   Not used for runtime at all.   
It's mostly for filling in things like the classname attribute of 
@RequestWrapper as well as for the types for the params at code generation 
time.

> But if that's the case, how does the code know which property of
> the wrapper bean corresponds to each child element of the wrapper? Does
> the CXF code just assume that the element names are identical to
> property names?

Well, runtime is different story.   For the most part, yes.  However, if the 
runtime DataBinding object implements the WrapperCapableDatabinding, then it 
provides the WrapperHelper object that would be used to set/get the params 
in/out of the wrapper object.    Thus, it can do whatever mapping it needs to 
do.   For example, JAXB will look at the @XmlElement annotations and such as 
well to map the names. 

 
> Also, when using JiBX data binding schema types may be used directly for
> child elements of the wrapper, meaning the return from these methods
> might be "java.lang.String", "java.lang.Integer", or even just "int" (in
> the case of a required element). How will CXF use these types of return
> values?

Just fine.   That would be the same for JAXB.


-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog

Reply via email to