cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Lambert (JIRA)" <>
Subject [jira] [Commented] (CXF-5815) cxf not unmarshalling parent elements
Date Fri, 20 Jun 2014 16:20:25 GMT


Michael Lambert commented on CXF-5815:

Looking ahead: I see a chance for namespace collisions if I simply use the element names in
the inTransformElementsMap.

For example if I have a payload such that an element with the same name exists in two different
  d1:foo {
How do I map that? Is there a way to specify that "" needs to include the d1 schema
and thefore exclude the root "id" element? If so, can that syntax also be used when mapping

> cxf not unmarshalling parent elements
> -------------------------------------
>                 Key: CXF-5815
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.7.11
>         Environment: ubuntu 13.10, oracle java 1.7, tomcat 7.0
>            Reporter: Michael Lambert
>         Attachments:,, beans.xml, common-v1.xsd, schema-0.0.1-SNAPSHOT-sources.jar,
schema-0.0.1-SNAPSHOT.jar, user-data-artifacts-0.0.1-SNAPSHOT-sources.jar, user-data-artifacts-0.0.1-SNAPSHOT.jar,
user-data-service-0.0.1-SNAPSHOT-sources.jar, user-data-service-0.0.1-SNAPSHOT.war, user-v1.xsd
> Base class elements are not being unmarshaled when passed into jax-rs service. For example
if I pass:
> {
>   "id": "12",
>   "name": "mike"
> }
> Where "id" comes from a base complexType:
> <xsd:complexType name="entityType" abstract="true">
> 		<xsd:sequence>
> 			<xsd:element name="id" type="tns:textType" minOccurs="0" maxOccurs="1" />
> 		</xsd:sequence>
> </xsd:complexType>
> and "name" comes from a complexType derived from the base type:
> <xsd:complexType name="userDataType">
> 		<xsd:complexContent>
> 			<xsd:extension base="common:entityType">
> 				<xsd:sequence>
> 					<xsd:element name="name" type="xsd:string" minOccurs="0" maxOccurs="1" />
> 				</xsd:sequence>
> 			</xsd:extension>
> 		</xsd:complexContent>
> </xsd:complexType>
> The service method does not receive the "id" value when the object is unmarshalled:
> public void get(UserDataType user) {
>     assert user.getName() != null : "this passes";
>     assert user.getId() != null : "this fails";
> }
> The elements that belong to the derived class (and not the base class) are passed properly
(i.e. they are populated with data).
> This happens only when I unmarshall json objects. It works fine with XML.
> The project is on github (
The schema with the parent "entityType" is located at
 The schema which contains the derived type is located at:
The dto classes are generated in the project:
And the service itself (including the cxf configuration which is in beans.xml) is located
The marshaller is configured in

This message was sent by Atlassian JIRA

View raw message