cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Sosnoski <>
Subject Re: [JiBX DataBinding] Question on handling Simple Types
Date Fri, 25 Jun 2010 16:55:54 GMT
Daniel Kulp wrote:
> Well, another option to consider (I'm not saying this is the way to go, just 
> something to consider.  I don't even know if this is possible with JIBX) is 
> how the JAXWS/JAXB code handles this....
> With JAX-WS/JAXB, it uses ASM to generate, in memory, classes for the wrapper 
> element which contains all the JAXB annotations and such necessary to 
> completely read/write the entire message body.   There is then a WrapperHelper 
> to pull the individual params out of that object.   Thus, JAXB doesn't see the 
> <arg0>Alice</arg0>, it sees the entire message as a structure.
> Right now, the creation of the wrapper beans is done in the JAX-WS frontend, 
> but I could definitely see pushing that into the JAXB databinding and allow 
> other databindings to do the same.   If you think it's possible with JIBX, 
> it's something we could look into more.

Ah, I hadn't realized this was the approach used by JAX-WS. That does 
tie it directly to JAXB and makes it pretty much unusable with other 
binding techniques. Ugly.

> The other option would be to just handle it yourself.   Get the element text, 
> you know the Class, since it would just be the primitives, the number of cases 
> you need to handle is pretty small and most of the code is probably already in 
> Aegis someplace.

The Axis2-JiBX code is already handling unmarshalling of these types, so 
I don't think the unmarshalling using JiBX is much of a problem. What's 
more difficult is actually relaying the unmarshalled data to the service 

Perhaps the cleanest way to handle this with JiBX in CXF is to have JiBX 
generate it's own wrapper classes which are unmarshalled normally. But 
then the data needs to be extracted from the wrapper class instance and 
passed to the service method. How is JAX-WS handling that extraction and 
data-passing step? If we could make it compatible for JiBX perhaps we 
could hook into the JAX-WS handling at that point.

The alternative is probably to only support wrapped method calls for 
now, where the wrapper class instance is passed directly to the method. 
That's somewhat ugly for client-side code, though.

  - Dennis

View raw message