You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by allam <al...@gmail.com> on 2013/06/13 16:46:24 UTC

JAX-RS: marshalling/unmarshalling between cxf 2.5 and cxf 2.7

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".

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? Which class was
modified?
and for which reason this modification was done between the two versions?


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-tp5729203.html
Sent from the cxf-dev mailing list archive at Nabble.com.