Thank you Jersey!


On Thu, Jun 13, 2013 at 6:39 PM, Sergey Beryozkin <[email protected]>wrote:

> Hi Diana
>
> On 13/06/13 17:09, diana-cxfUser allam-cxfUser wrote:
>
>> Hello,
>>
>> What is the provider exactly?
>> For the marshaling process, I understood that there are a DataWriter and a
>> DataBinding instance (JAXB by default).
>> I suppose that, in the cxf 2.4, the JAXBDataBinding instance (
>> http://cxf.apache.org/javadoc/**latest/org/apache/cxf/jaxb/**
>> JAXBDataBinding.html#**JAXBDataBinding%28java.lang.**Class...%29<http://cxf.apache.org/javadoc/latest/org/apache/cxf/jaxb/JAXBDataBinding.html#JAXBDataBinding%28java.lang.Class...%29>
>> )
>> has Resource2 class as a context.
>> In cxf 2.7, JAXBDataBinding instance has Resource1 class as a context.
>> Is the provider a specific class in cxf which specifies the Data Binding
>> context?
>>
>>  I think we discussed it before. You are right, DataWriter and
> DataBinding are used by CXF but mainly when working with WS/Soap services.
> Note, it is possible to use CXF DataBindings (those typically used by WS)
> in RS endpoints too, but this is not a mainstream case, by default JAX-RS
> runtime uses JAX-RS MessageBodyWriter and MessageBodyReader - these are
> providers, the 'data bindings' in the JAX-RS world
>
>  I have another question please: Are  the marshalling/unmarshalling results
>> the same for all data bindings? for example Aegis?
>> SDO, Json Data Bindings and others implemented in Cxf?
>> In cxf, there are different DataReaders and DataWriters for each data
>> binding.
>> Does that modify the marshalling/unmarshalling of messages?
>> Indeed, by considering a POJO approach, is there a real difference between
>> these data bindings?
>> Except performance criterion maybe and the ability to convert some
>> particular XML syntax into Java?
>>
>>  I think every CXF data binding will likely produce a slighty different
> XML, though I guess in some cases there could be matches
>
> Sergey
>
>> Regards,
>>
>> Diana
>>
>>
>>
>> On Thu, Jun 13, 2013 at 5:34 PM, Sergey Beryozkin <[email protected]
>> >wrote:
>>
>>  Hi
>>>
>>> On 13/06/13 15:22, allam wrote:
>>>
>>>  Hello,
>>>>
>>>> I have a restful service which implements the following interface:
>>>> @Path("/service/")
>>>> public interface ServiceInterface {
>>>>
>>>>       @POST
>>>>       @Path("/resources/")
>>>>       public void op(Resource1 r);
>>>>
>>>> }
>>>>
>>>> and I have two classes Resource1 and Resource2, such that Resource2
>>>> extends
>>>> Resource1.
>>>> (I am not using @XmlSeeAlso annotation in Resource1 class to bind on
>>>> Resource2 class).
>>>> I would like to call the service method op, using an instance of
>>>> Resource2.
>>>>
>>>> Before, by using CXF 2.5, the Resource2 instance is marshalled to the
>>>> following XML :
>>>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>>>> <resource2>
>>>>      <attr1>default</attr1>
>>>>      <attr2>0</attr2>
>>>> </resource2>
>>>>
>>>> and an exception is thrown at reception because the expected root
>>>> element
>>>> is
>>>> "resource1" not "resource2".
>>>>
>>>>  That is correct I guess
>>>
>>>
>>>  While by using CXF 2.7, the Resource2 instance is marshalled to the
>>>> following XML:
>>>> <resource1>
>>>>      <attr1>default</attr1>
>>>> </resource1>
>>>>
>>>> And there isn't any exception at reception.
>>>> That means, in CXF 2.5, the marshalling type was the dynamic type, while
>>>> in
>>>> the cxf 2.7 version, the marshalling type is the static type.
>>>> What does make this change between the two versions?
>>>> and for which reason this modification was done between the two
>>>> versions?
>>>>
>>>>  In CXF 2.5.x the actual object instance class was reported to the
>>> providers, in CXF 2.7.x - the class of the method parameter, which is
>>> correct.
>>> The fact that no exception is reported is good. I think you need now to
>>> use XmlSeeAlso or may be configure JAXBElementProvider to report xsi:type
>>> if needed, etc, and on the client side, check please
>>>
>>> http://cxf.apache.org/docs/****jax-rs-data-bindings.html#JAX-****<http://cxf.apache.org/docs/**jax-rs-data-bindings.html#JAX-**>
>>> RSDataBindings-****CommonJAXBandJSONconfiguration**<
>>> http://cxf.apache.org/docs/**jax-rs-data-bindings.html#JAX-**
>>> RSDataBindings-**CommonJAXBandJSONconfiguration<http://cxf.apache.org/docs/jax-rs-data-bindings.html#JAX-RSDataBindings-CommonJAXBandJSONconfiguration>
>>> **>
>>>
>>> Cheers, Sergey
>>>
>>>
>>>
>>>
>>>> Regards,
>>>>
>>>> Diana
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context: http://cxf.547215.n5.nabble.**
>>>> com/JAX-RS-marshalling-****unmarshalling-between-cxf-2-5-****
>>>> and-cxf-2-7-tp5729200.html<htt**p://cxf.547215.n5.nabble.com/**
>>>> JAX-RS-marshalling-**unmarshalling-between-cxf-2-5-**
>>>> and-cxf-2-7-tp5729200.html<http://cxf.547215.n5.nabble.com/JAX-RS-marshalling-unmarshalling-between-cxf-2-5-and-cxf-2-7-tp5729200.html>
>>>> >
>>>>
>>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>>
>>>>
>>>>
>>> --
>>> Sergey Beryozkin
>>>
>>> Talend Community Coders
>>> http://coders.talend.com/
>>>
>>> Blog: http://sberyozkin.blogspot.com
>>>
>>>
>>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com
>

Reply via email to