[
https://issues.apache.org/jira/browse/CXF-2041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12673749#action_12673749
]
Benson Margulies commented on CXF-2041:
---------------------------------------
I've verified that this lives inside the jaxb ri, by running the following and
examining the resulting schema, which is deposited in the 'sg' subdirectory. If
contains a schema element for 'parent' inside 'Child'.
#!/bin/sh
per=/Users/benson/.m2/repository/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar
jaxws=/Users/benson/.m2/repository/org/apache/geronimo/specs/geronimo-jaxws_2.1_spec/1.0/geronimo-jaxws_2.1_spec-1.0.jar
wsm=/Users/benson/.m2/repository/org/apache/geronimo/specs/geronimo-ws-metadata_2.0_spec/1.1.2/geronimo-ws-metadata_2.0_spec-1.1.2.jar
~/cxf/jaxb/jaxb-ri-2.1.9/bin/schemagen.sh -cp $per:$jaxws:$wsm:target/classes
-d sg src/main/java/com/example/test/cxf/xmltransient/model/Child.java
src/main/java/com/example/test/cxf/xmltransient/model/EntityObject.java
src/main/java/com/example/test/cxf/xmltransient/model/Parent.java
src/main/java/com/example/test/cxf/xmltransient/ws/ExampleWebService.java
> XmlTransient annotation seems to be ignored
> -------------------------------------------
>
> Key: CXF-2041
> URL: https://issues.apache.org/jira/browse/CXF-2041
> Project: CXF
> Issue Type: Bug
> Components: JAXB Databinding
> Affects Versions: 2.1.4
> Environment: Spring 2.5.6
> Reporter: Kariem Hussein
> Attachments: test-cxf-xmltransient.zip
>
>
> Properties marked with @XmlTransient should be prevented from being mapped
> to XML. For two objects with a parent-child relationship where the object
> references are bi-directional, properties annotated accordingly should be
> ignored during marshalling. I have tried different options, but could never
> observe that @XmlTransient is actually taken into account.
> # examples in peudo-code (test project will be attached)
> Models:
> class Parent {
> List<Child> children;
> }
> class Child {
> @XmlTransient // <-- annotated to exclude this property from XML
> marshalling
> Parent parent;
> }
> Test:
> testMarshalling {
> Parent p = new Parent();
> Child c = new Child();
> c.setParent(p);
> p.setChildren(Arrays.asList(c));
> doSomethingViaWebService(p); // <-- throws Exception here
> }
> I could imagine that some problems arise when using another spring version
> than the one packaged with CXF, but I think there should not be issues in
> such a limited scenario. Either the documentation is missing important
> parameters or there is actually a problem somewhere.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.