On Tuesday 28 December 2010 2:31:52 pm ntchoate wrote: > Sergey Beryozkin-5 wrote: > > Does it help ? Or do you need to use your own custom MessageBodyWriter ? > > Ex, > > JAXBElementProvider with some configuration properties which are not > > available with the JAXBDataBinding ? > > > > cheers, Sergey > > I think you confirmed what I already thought I would have to resort to. > I'm not a big fan of JAXB, and thought it was much simpler to write my own > small XML marshallers utilizing the STaX API, since each marshaller was > only about 4 lines of code and I only needed a few. In addition, by using > the STaX API, I could leverage jettison to produce JSON output using my > existing XML marshalling classes. I was really just looking for a way to > keep my XML/JSON format separate from my object model. > > If I were to boil my question down to a more succinct version, will CXF in > the future support a similar serialization mechanism between jax-rs and > jax-ws (MessageBodyWriter/Reader vs DataBinding), or are the specs simply > incompatible to support such a feature?
As Sergey already mentioned, he did commit a simple DataBinding that can accomplish some of this that SHOULD work for your usecase. The main issue is that JAX-RS providers are a bit more "generic" in that they can support read/write directly to the input/output streams which is not really possible for the SOAP/DataBinding use case. If your provider is only using XMLStreamReader/Writers, we can do some sort of mapping that onto to the SOAP/DataBinding things, but for the other cases, we cannot really do that. The SOAP stuff really requires the use of the STaX stuff. -- Daniel Kulp [email protected] http://dankulp.com/blog
